Changes in src/tests/test.py [4782b39:850fda6]
- File:
-
- 1 edited
-
src/tests/test.py (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/test.py
r4782b39 r850fda6 104 104 # running test functions 105 105 ################################################################################ 106 def run_single_test(test, generate, dry_run , debug):106 def run_single_test(test, generate, dry_run): 107 107 108 108 # find the output file based on the test name and options flag … … 113 113 sh("rm -f %s > /dev/null 2>&1" % test.name, dry_run) 114 114 115 options = "-debug" if debug else "-nodebug";116 117 115 # build, skipping to next test on error 118 make_ret, _ = sh(" ""%s EXTRA_FLAGS="-quiet %s" %s 2> %s 1> /dev/null""" % (make_cmd, options, test.name, out_file), dry_run)116 make_ret, _ = sh("%s %s 2> %s 1> /dev/null" % (make_cmd, test.name, out_file), dry_run) 119 117 120 118 # if the make command succeds continue otherwise skip to diff … … 167 165 return retcode, error 168 166 169 def run_test_instance(t, generate, dry_run , debug) :167 def run_test_instance(t, generate, dry_run) : 170 168 # print formated name 171 169 name_txt = "%20s " % t.name 172 170 173 171 #run the test instance and collect the result 174 test_failed, error = run_single_test(t, generate, dry_run , debug)172 test_failed, error = run_single_test(t, generate, dry_run) 175 173 176 174 # update output based on current action … … 196 194 197 195 # run the given list of tests with the given parameters 198 def run_tests(tests, generate, dry_run, jobs , debug) :196 def run_tests(tests, generate, dry_run, jobs) : 199 197 # clean the sandbox from previous commands 200 198 sh("%s clean > /dev/null 2>&1" % make_cmd, dry_run) … … 209 207 pool = Pool(jobs) 210 208 try : 211 results = pool.map_async(partial(run_test_instance, generate=generate, dry_run=dry_run , debug=debug), tests ).get(99999999)209 results = pool.map_async(partial(run_test_instance, generate=generate, dry_run=dry_run), tests ).get(99999999) 212 210 except KeyboardInterrupt: 213 211 pool.terminate() … … 224 222 return 0 225 223 226 def yes_no(string):227 if string == "yes" :228 return True229 if string == "no" :230 return False231 raise argparse.ArgumentTypeError(msg)232 return False233 234 235 224 ################################################################################ 236 225 # main loop … … 238 227 # create a parser with the arguments for the tests script 239 228 parser = argparse.ArgumentParser(description='Script which runs cforall tests') 240 parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='no')241 229 parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true') 242 230 parser.add_argument('--list', help='List all test available', action='store_true') … … 308 296 sys.exit(1) 309 297 310 print('Running (%s) on %i cores' % ("debug" if options.debug else "no debug", options.jobs))298 print('Running on %i cores' % options.jobs) 311 299 make_cmd = "make" if make_flags else ("make -j%i" % options.jobs) 312 300 … … 317 305 else : 318 306 # otherwise run all tests and make sure to return the correct error code 319 sys.exit( run_tests(tests, options.regenerate_expected, options.dry_run, options.jobs , options.debug) )307 sys.exit( run_tests(tests, options.regenerate_expected, options.dry_run, options.jobs) )
Note:
See TracChangeset
for help on using the changeset viewer.