Commit 2e2d3d18f70afd5b2b62afd093a2b5fd088c971b
1 parent
60a2b36f
Add test return code for correct tracking of failures.
Added call to sys.exit so that a failure is correctly reported to make check.
Showing
1 changed file
with
8 additions
and
14 deletions
test/test_python.py
| ... | ... | @@ -454,20 +454,13 @@ def test_optimise(): |
| 454 | 454 | # ======================== # |
| 455 | 455 | if __name__ == '__main__': |
| 456 | 456 | """ |
| 457 | - Perform testing. | |
| 457 | + Perform unit testing for Python interface. | |
| 458 | 458 | """ |
| 459 | - # Dump result | |
| 460 | - sys.stdout.write("\n") | |
| 461 | - sys.stdout.write("****************************\n") | |
| 462 | - sys.stdout.write("* Python interface testing *\n") | |
| 463 | - sys.stdout.write("****************************\n") | |
| 464 | - | |
| 465 | 459 | # Initialise success counter |
| 466 | - tests = 0 | |
| 467 | 460 | success = 0 |
| 468 | 461 | |
| 469 | 462 | # Allocate test suites |
| 470 | - suites = GTestSuites("Python suites") | |
| 463 | + suites = GTestSuites("Python interface testing") | |
| 471 | 464 | |
| 472 | 465 | # Allocate test suites and append them to the container |
| 473 | 466 | suite1 = TestGFits() |
| ... | ... | @@ -484,9 +477,10 @@ if __name__ == '__main__': |
| 484 | 477 | # Save test results |
| 485 | 478 | suites.save("reports/GPython.xml") |
| 486 | 479 | |
| 487 | - # Perform tests | |
| 488 | -# test_node_array() | |
| 489 | -# test_lat_response() | |
| 490 | -# test_lat_observation() | |
| 491 | -# test_optimise() | |
| 480 | + # Exit with return code | |
| 481 | + if success: | |
| 482 | + rc = 0 | |
| 483 | + else: | |
| 484 | + rc = 1 | |
| 485 | + sys.exit(rc) | |
| 492 | 486 | ... | ... |