Changeset cc9b520 for tests/pybin
- 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/pybin
- Files:
-
- 2 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
Note: See TracChangeset
for help on using the changeset viewer.