Changeset c76bd34 for tests/test.py
- Timestamp:
- Oct 7, 2020, 4:31:43 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 848439f
- Parents:
- ae2c27a (diff), 597c5d18 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/test.py
rae2c27a rc76bd34 173 173 test.prepare() 174 174 175 # ---------- 176 # MAKE 177 # ---------- 175 178 # build, skipping to next test on error 176 179 with Timed() as comp_dur: 177 180 make_ret, _ = make( test.target(), output_file=subprocess.DEVNULL, error=out_file, error_file = err_file ) 178 181 182 # ---------- 183 # RUN 184 # ---------- 185 # run everything in a temp directory to make sure core file are handled properly 179 186 run_dur = None 180 # run everything in a temp directory to make sure core file are handled properly181 187 with tempdir(): 182 188 # if the make command succeeds continue otherwise skip to diff … … 207 213 else: 208 214 if os.stat(out_file).st_size < 1048576: 209 with open (out_file, "r" ) as myfile:215 with open (out_file, "r", encoding='latin-1') as myfile: # use latin-1 so all chars mean something. 210 216 error = myfile.read() 211 217 else: … … 256 262 make('clean', output_file=subprocess.DEVNULL, error=subprocess.DEVNULL) 257 263 258 # since python prints stacks by default on a interrupt, redo the interrupt handling to be silent 259 def worker_init(): 260 def sig_int(signal_num, frame): 261 pass 262 263 signal.signal(signal.SIGINT, sig_int) 264 265 # create the executor for our jobs and handle the signal properly 266 pool = multiprocessing.Pool(jobs, worker_init) 264 # create the executor for our jobs 265 pool = multiprocessing.Pool(jobs) 267 266 268 267 failed = False 269 270 def stop(x, y):271 print("Tests interrupted by user", file=sys.stderr)272 sys.exit(1)273 signal.signal(signal.SIGINT, stop)274 268 275 269 # for each test to run … … 360 354 failed = 0 361 355 356 # check if the expected files aren't empty 357 if not options.regenerate_expected: 358 for t in tests: 359 if is_empty(t.expect()): 360 print('WARNING: test "{}" has empty .expect file'.format(t.target()), file=sys.stderr) 361 362 362 # for each build configurations, run the test 363 363 with Timed() as total_dur:
Note:
See TracChangeset
for help on using the changeset viewer.