- Timestamp:
- Jul 15, 2016, 4:10:11 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- b8303f44
- Parents:
- 911348cd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/test.py
r911348cd r52c97dd 181 181 for t in tests: 182 182 # print formated name 183 print("%20s " % t.name, end="") 184 sys.stdout.flush() 183 name_txt = "%20s " % t.name 185 184 186 185 #run the test instance and collect the result … … 199 198 200 199 #print result with error if needed 201 print(failed_txt if test_failed else success_txt) 200 text = name_txt + (failed_txt if test_failed else success_txt) 201 out = sys.stdout 202 202 if error : 203 print(error, file=sys.stderr) 203 text = text + "\n" + error 204 out = sys.stderr 205 206 print(text, file = out); 204 207 205 208 #clean the workspace … … 217 220 parser.add_argument('--all', help='Run all test available', action='store_true') 218 221 parser.add_argument('--regenerate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true') 219 parser.add_argument('-j', '--jobs', help='Number of tests to run simultaneously', type=int, default=' 1')222 parser.add_argument('-j', '--jobs', help='Number of tests to run simultaneously', type=int, default='8') 220 223 parser.add_argument('tests', metavar='test', type=str, nargs='*', help='a list of tests to run') 221 224 … … 266 269 # check if the user already passed in a number of jobs for multi-threading 267 270 make_flags = environ.get('MAKEFLAGS') 268 make_has_max_jobs = make_flags and "-j" in make_flags269 make_max_jobs = re.search("(-j|--jobs)\s*([0-9]+)", make_flags).group(2) if make_has_max_jobs else None270 make_cmd = "make" if make_ has_max_jobs else "make -j8"271 make_has_max_jobs = re.search("(-j|--jobs)\s*([0-9]+)", make_flags) if make_flags else None 272 make_max_jobs = make_has_max_jobs.group(2) if make_has_max_jobs else None 273 make_cmd = "make" if make_flags and "-j" in make_flags else "make -j8" 271 274 272 275 # make sure we have a valid number of jobs that corresponds to user input … … 276 279 sys.exit(1) 277 280 278 279 281 # users may want to simply list the tests 280 282 if options.list : … … 283 285 else : 284 286 # otherwise run all tests and make sure to return the correct error code 285 sys.exit( run_tests(tests, options.regenerate_expected, options.dry_run ) )287 sys.exit( run_tests(tests, options.regenerate_expected, options.dry_run, options.jobs) )
Note: See TracChangeset
for help on using the changeset viewer.