Changeset 6c00702 in sasview for test/utest_sansview.py
- Timestamp:
- Apr 4, 2014 10:44:59 AM (10 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- d44648e
- Parents:
- e6d9703
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/utest_sansview.py
rbbd97e5 r6c00702 26 26 # COMMAND_SEP = '&' 27 27 28 def run_tests( ):28 def run_tests(dirs=None, all=False): 29 29 test_root = os.path.abspath(os.path.dirname(__file__)) 30 30 run_one_py = os.path.join(test_root, 'run_one.py') … … 35 35 n_failures = 0 36 36 37 for d in os.listdir(test_root):37 for d in (dirs if dirs else os.listdir(test_root)): 38 38 39 39 # Check for modules to be skipped … … 76 76 passed += 1 77 77 print "Result for %s: SUCCESS" % module_name 78 78 79 79 print "\n----------------------------------------------" 80 print "Results by test modules:" 81 print " PASSED: %d" % passed 82 ratio = 100.0*failed/(failed+passed) 83 print " FAILED: %d (%.0f%%)" % (failed,ratio) 84 85 print "Results by tests:" 86 print " Tests run: %d" % n_tests 87 print " Tests failed: %d" % n_failures 88 print " Test errors: %d" % n_errors 80 if n_tests == 0: 81 print "No tests." 82 else: 83 print "Results by test modules:" 84 print " PASSED: %d" % passed 85 ratio = 100.0*failed/(failed+passed) 86 print " FAILED: %d (%.0f%%)" % (failed,ratio) 87 88 print "Results by tests:" 89 print " Tests run: %d" % n_tests 90 print " Tests failed: %d" % n_failures 91 print " Test errors: %d" % n_errors 89 92 print "----------------------------------------------" 90 93 … … 92 95 93 96 if __name__ == '__main__': 94 if run_tests()>0: 97 all = (len(sys.argv) > 1 and sys.argv[1] == '-all') 98 dirs = sys.argv[1:] if not all else sys.argv[2:] 99 if run_tests(dirs=dirs, all=all)>0: 95 100 sys.exit(1) 96 101
Note: See TracChangeset
for help on using the changeset viewer.