Changeset e791851
- Timestamp:
- Jun 25, 2019, 3:19:49 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- ab8315f
- Parents:
- 8ecb590
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/test.py
r8ecb590 re791851 202 202 if error : 203 203 text = text + '\n' + error 204 out = sys.stderr 205 206 print(text, file = out) 207 sys.stdout.flush() 208 sys.stderr.flush() 209 210 return retcode != TestResult.SUCCESS 204 205 return retcode == TestResult.SUCCESS, text 211 206 except KeyboardInterrupt: 212 False 207 False, "" 213 208 214 209 # run the given list of tests with the given parameters … … 220 215 pool = multiprocessing.Pool(jobs) 221 216 217 failed = False 218 222 219 # for each test to run 223 220 try : 224 results = pool.map_async( 221 num = len(tests) 222 fancy = sys.stdout.isatty() 223 for i, (succ, txt) in enumerate(pool.imap( 225 224 run_test_worker, 226 225 tests, 227 226 chunksize = 1 228 ).get(settings.timeout.total) 227 )) : 228 if not succ : 229 failed = True 230 231 print(" " + txt) 232 233 if(fancy and i != num): 234 print("%d/%d" % (i, num), end='\r') 235 sys.stdout.flush() 236 229 237 except KeyboardInterrupt: 230 238 pool.terminate() 231 print("Tests interrupted by user") 232 sys.exit(1) 239 print("Tests interrupted by user", file=sys.stderr) 240 failed = True 241 except multiprocessing.TimeoutError: 242 pool.terminate() 243 print("ERROR: Test suite timed out", file=sys.stderr) 244 failed = True 233 245 234 246 # clean the workspace 235 247 make('clean', output=subprocess.DEVNULL, error=subprocess.DEVNULL) 236 248 237 for failed in results: 238 if failed : 239 return 1 240 241 return 0 249 return 1 if failed else 0 242 250 243 251
Note: See TracChangeset
for help on using the changeset viewer.