- Timestamp:
- Apr 3, 2014 8:59:01 PM (11 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:
- eea06fe
- Parents:
- 27b7acc
- Location:
- test
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/utest_sansview.py
r21b7a49 rbbd97e5 8 8 print "xmlrunner needs to be installed to run these tests" 9 9 print "Try easy_install unittest-xml-reporting" 10 sys.exit(1) 10 11 11 12 # Check whether we have matplotlib installed … … 21 22 SKIPPED_DIRS.append("sansguiframe") 22 23 23 COMMAND_SEP = ';'24 if os.name == 'nt':25 COMMAND_SEP = '&'24 #COMMAND_SEP = ';' 25 #if os.name == 'nt': 26 # COMMAND_SEP = '&' 26 27 27 28 def run_tests(): 29 test_root = os.path.abspath(os.path.dirname(__file__)) 30 run_one_py = os.path.join(test_root, 'run_one.py') 28 31 passed = 0 29 32 failed = 0 … … 32 35 n_failures = 0 33 36 34 for d in os.listdir( os.getcwd()):37 for d in os.listdir(test_root): 35 38 36 39 # Check for modules to be skipped … … 39 42 40 43 # Go through modules looking for unit tests 41 module_dir = os.path.join( os.getcwd(),d,"test")44 module_dir = os.path.join(test_root, d, "test") 42 45 if os.path.isdir(module_dir): 43 46 for f in os.listdir(module_dir): … … 45 48 if os.path.isfile(file_path) and f.startswith("utest_") and f.endswith(".py"): 46 49 module_name,_ = os.path.splitext(f) 47 code = "cd %s%s%s -c \"import sys;import xmlrunner;import unittest;sys.path.insert(0, '%s');" % (module_dir, COMMAND_SEP, sys.executable, module_dir) 48 code += "from %s import *;" % module_name 49 code += "unittest.main(testRunner=xmlrunner.XMLTestRunner(output='logs'))\"" 50 code = '"%s" %s %s'%(sys.executable, run_one_py, file_path) 50 51 proc = subprocess.Popen(code, shell=True, stdout=subprocess.PIPE, stderr = subprocess.STDOUT) 51 52 std_out, std_err = proc.communicate() 53 #print std_out 54 #sys.exit() 52 55 has_failed = True 53 56 m = re.search("Ran ([0-9]+) test", std_out)
Note: See TracChangeset
for help on using the changeset viewer.