Changeset cc9b520
- Timestamp:
- Mar 9, 2022, 7:59:46 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- b053083
- Parents:
- 5baa33c
- Location:
- tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/pybin/settings.py
r5baa33c rcc9b520 192 192 global distcc 193 193 distcc = "DISTCC_CFA_PATH=~/.cfadistcc/%s/cfa" % tools.config_hash() 194 errf = os.path.join(BUILDDIR, ".validate.err") 195 make_ret, out = tools.make( ".validate", error_file = errf, output_file=subprocess.DEVNULL, error=subprocess.DEVNULL ) 194 make_ret, out, err = tools.make( ".validate", output_file=subprocess.PIPE, error=subprocess.PIPE ) 196 195 if make_ret != 0: 197 with open (errf, "r") as myfile:198 error=myfile.read()199 196 print("ERROR: Invalid configuration %s:%s" % (arch.string, debug.string), file=sys.stderr) 200 print(" verify returned : \n%s" % error, file=sys.stderr) 201 tools.rm(errf) 197 print(" verify returned : \n%s" % err, file=sys.stderr) 202 198 sys.exit(1) 203 204 tools.rm(errf)205 199 206 200 def prep_output(tests): -
tests/pybin/tools.py
r5baa33c rcc9b520 70 70 71 71 try: 72 out, _= proc.communicate(72 out, errout = proc.communicate( 73 73 timeout = settings.timeout.single if timeout else None 74 74 ) 75 75 76 return proc.returncode, out.decode("latin-1") if out else None 76 return proc.returncode, out.decode("latin-1") if out else None, errout.decode("latin-1") if errout else None 77 77 except subprocess.TimeoutExpired: 78 78 if settings.timeout2gdb: 79 79 print("Process {} timeout".format(proc.pid)) 80 80 proc.communicate() 81 return 124, str(None) 81 return 124, str(None), "Subprocess Timeout 2 gdb" 82 82 else: 83 83 proc.send_signal(signal.SIGABRT) 84 84 proc.communicate() 85 return 124, str(None) 85 return 124, str(None), "Subprocess Timeout 2 gdb" 86 86 87 87 except Exception as ex: … … 106 106 return (False, "No file") 107 107 108 code, out = sh("file", fname, output_file=subprocess.PIPE)108 code, out, err = sh("file", fname, output_file=subprocess.PIPE) 109 109 if code != 0: 110 return (False, "'file EXPECT' failed with code {} ".format(code))110 return (False, "'file EXPECT' failed with code {} '{}'".format(code, err)) 111 111 112 112 match = re.search(".*: (.*)", out) … … 242 242 # move a file 243 243 def mv(source, dest): 244 ret, _ = sh("mv", source, dest)244 ret, _, _ = sh("mv", source, dest) 245 245 return ret 246 246 247 247 # cat one file into the other 248 248 def cat(source, dest): 249 ret, _ = sh("cat", source, output_file=dest)249 ret, _, _ = sh("cat", source, output_file=dest) 250 250 return ret 251 251 … … 291 291 ################################################################################ 292 292 def jobserver_version(): 293 make_ret, out = sh('make', '.test_makeflags', '-j2', output_file=subprocess.PIPE)293 make_ret, out, err = sh('make', '.test_makeflags', '-j2', output_file=subprocess.PIPE, error=subprocess.PIPE) 294 294 if make_ret != 0: 295 with open (errf, "r") as myfile:296 error=myfile.read()297 295 print("ERROR: cannot find Makefile jobserver version", file=sys.stderr) 298 print(" test returned : \n%s" % out, file=sys.stderr)296 print(" test returned : {} '{}'".format(make_ret, err), file=sys.stderr) 299 297 sys.exit(1) 300 298 … … 302 300 if not re_jobs: 303 301 print("ERROR: cannot find Makefile jobserver version", file=sys.stderr) 304 print(" MAKEFLAGS are : \n%s" % out, file=sys.stderr)302 print(" MAKEFLAGS are : '{}'".format(out), file=sys.stderr) 305 303 sys.exit(1) 306 304 … … 344 342 # remote hardware is allowed 345 343 # how much do we have? 346 ret, jstr = sh("distcc", "-j", output_file=subprocess.PIPE, ignore_dry_run=True)344 ret, jstr, _ = sh("distcc", "-j", output_file=subprocess.PIPE, ignore_dry_run=True) 347 345 return int(jstr.strip()) if ret == 0 else multiprocessing.cpu_count() 348 346 else: … … 445 443 distcc_hash = os.path.join(settings.SRCDIR, '../tools/build/distcc_hash') 446 444 config = "%s-%s" % (settings.arch.target, settings.debug.path) 447 _, out = sh(distcc_hash, config, output_file=subprocess.PIPE, ignore_dry_run=True)445 _, out, _ = sh(distcc_hash, config, output_file=subprocess.PIPE, ignore_dry_run=True) 448 446 return out.strip() 449 447 -
tests/test.py
r5baa33c rcc9b520 195 195 # build, skipping to next test on error 196 196 with Timed() as comp_dur: 197 make_ret, _ = make( test.target(), output_file=subprocess.DEVNULL, error=out_file, error_file = err_file )197 make_ret, _, _ = make( test.target(), output_file=subprocess.DEVNULL, error=out_file, error_file = err_file ) 198 198 199 199 # ---------- … … 208 208 if settings.dry_run or is_exe(exe_file): 209 209 # run test 210 retcode, _ = sh(exe_file, output_file=out_file, input_file=in_file, timeout=True)210 retcode, _, _ = sh(exe_file, output_file=out_file, input_file=in_file, timeout=True) 211 211 else : 212 212 # simply cat the result into the output … … 226 226 else : 227 227 # fetch return code and error from the diff command 228 retcode, error = diff(cmp_file, out_file)228 retcode, error, _ = diff(cmp_file, out_file) 229 229 230 230 else: … … 235 235 error = "Output log can't be read, file is bigger than 1MB, see {} for actual error\n".format(out_file) 236 236 237 ret, info = core_info(exe_file) 238 error = error + info if error else info 237 ret, info, gdberr = core_info(exe_file) 238 if ret == 0: 239 error = error + info if error else info 240 else : 241 error = error + gdberr if error else gdberr 239 242 240 243 if settings.archive: … … 366 369 print(os.path.relpath(t.expect(), settings.SRCDIR), end=' ') 367 370 print(os.path.relpath(t.input() , settings.SRCDIR), end=' ') 368 code, out = make_recon(t.target())371 code, out, err = make_recon(t.target()) 369 372 370 373 if code != 0: 371 print('ERROR: recond failed for test {} '.format(t.target()), file=sys.stderr)374 print('ERROR: recond failed for test {}: {} \'{}\''.format(t.target(), code, err), file=sys.stderr) 372 375 sys.exit(1) 373 376
Note: See TracChangeset
for help on using the changeset viewer.