Commit 37dff2d7999dc8cce27c233d023c97a1a9a28520
1 parent
38ec2443
Rename some test suites and optionally include also instrument test suites.
Showing
1 changed file
with
51 additions
and
13 deletions
test/test_python.py
| ... | ... | @@ -21,18 +21,39 @@ |
| 21 | 21 | from gammalib import * |
| 22 | 22 | from math import * |
| 23 | 23 | import sys |
| 24 | -import test_GApp | |
| 24 | +import test_GApplication | |
| 25 | 25 | import test_GLinalg |
| 26 | 26 | import test_GModel |
| 27 | 27 | import test_GNumerics |
| 28 | -import test_GObs | |
| 29 | -import test_GOpt | |
| 28 | +import test_GObservation | |
| 29 | +import test_GOptimizer | |
| 30 | 30 | import test_GFits |
| 31 | 31 | import test_GSky |
| 32 | 32 | import test_GSupport |
| 33 | 33 | import test_GTest |
| 34 | 34 | import test_GXml |
| 35 | 35 | |
| 36 | +# Try importing CTA tests | |
| 37 | +try: | |
| 38 | + import test_CTA | |
| 39 | + has_cta = True | |
| 40 | +except: | |
| 41 | + has_cta = False | |
| 42 | + | |
| 43 | +# Try importing LAT tests | |
| 44 | +try: | |
| 45 | + import test_LAT | |
| 46 | + has_lat = True | |
| 47 | +except: | |
| 48 | + has_lat = False | |
| 49 | + | |
| 50 | +# Try importing MWL tests | |
| 51 | +try: | |
| 52 | + import test_MWL | |
| 53 | + has_mwl = True | |
| 54 | +except: | |
| 55 | + has_mwl = False | |
| 56 | + | |
| 36 | 57 | |
| 37 | 58 | # ======================== # |
| 38 | 59 | # Main routine entry point # |
| ... | ... | @@ -45,15 +66,15 @@ if __name__ == '__main__': |
| 45 | 66 | suites = GTestSuites("Python interface testing") |
| 46 | 67 | |
| 47 | 68 | # Allocate test suites and append them to the container |
| 48 | - suite1 = test_GApp.Test() | |
| 49 | - suite2 = test_GFits.Test() | |
| 50 | - suite3 = test_GLinalg.Test() | |
| 51 | - suite4 = test_GModel.Test() | |
| 52 | - suite5 = test_GNumerics.Test() | |
| 53 | - suite6 = test_GObs.Test() | |
| 54 | - suite7 = test_GOpt.Test() | |
| 55 | - suite8 = test_GSky.Test() | |
| 56 | - suite9 = test_GSupport.Test() | |
| 69 | + suite1 = test_GApplication.Test() | |
| 70 | + suite2 = test_GFits.Test() | |
| 71 | + suite3 = test_GLinalg.Test() | |
| 72 | + suite4 = test_GModel.Test() | |
| 73 | + suite5 = test_GNumerics.Test() | |
| 74 | + suite6 = test_GObservation.Test() | |
| 75 | + suite7 = test_GOptimizer.Test() | |
| 76 | + suite8 = test_GSky.Test() | |
| 77 | + suite9 = test_GSupport.Test() | |
| 57 | 78 | suite10 = test_GTest.Test() |
| 58 | 79 | suite11 = test_GXml.Test() |
| 59 | 80 | |
| ... | ... | @@ -83,9 +104,26 @@ if __name__ == '__main__': |
| 83 | 104 | suites.append(suite10) |
| 84 | 105 | suites.append(suite11) |
| 85 | 106 | |
| 107 | + # Optionally handle CTA suite | |
| 108 | + if has_cta: | |
| 109 | + suite_cta = test_CTA.Test() | |
| 110 | + suite_cta.set() | |
| 111 | + suites.append(suite_cta) | |
| 112 | + | |
| 113 | + # Optionally handle LAT suite | |
| 114 | + if has_lat: | |
| 115 | + suite_lat = test_LAT.Test() | |
| 116 | + suite_lat.set() | |
| 117 | + suites.append(suite_lat) | |
| 118 | + | |
| 119 | + # Optionally handle MWL suite | |
| 120 | + if has_mwl: | |
| 121 | + suite_mwl = test_MWL.Test() | |
| 122 | + suite_mwl.set() | |
| 123 | + suites.append(suite_mwl) | |
| 124 | + | |
| 86 | 125 | # Run test suite |
| 87 | 126 | success = suites.run() |
| 88 | - #print suites | |
| 89 | 127 | |
| 90 | 128 | # Save test results |
| 91 | 129 | suites.save("reports/GPython.xml") | ... | ... |