diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-06 18:21:01 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 14:23:24 -0800 |
commit | bc9ae1361971f1f4d6bfa4af63d027f5e5bc30c4 (patch) | |
tree | 70a012100f89e49c6a07b87b64c9d04f1d390566 /tools/shared.py | |
parent | 556924460a93c8d7218225b8c52c4de1fef3c730 (diff) |
improve bisection tool to not ignore stderr
Diffstat (limited to 'tools/shared.py')
-rw-r--r-- | tools/shared.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/shared.py b/tools/shared.py index 86a5ba77..18a32d27 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -433,7 +433,7 @@ def check_engine(engine): print 'Checking JS engine %s failed. Check %s. Details: %s' % (str(engine), EM_CONFIG, str(e)) return False -def timeout_run(proc, timeout, note='unnamed process'): +def timeout_run(proc, timeout, note='unnamed process', full_output=False): start = time.time() if timeout is not None: while time.time() - start < timeout and proc.poll() is None: @@ -441,13 +441,14 @@ def timeout_run(proc, timeout, note='unnamed process'): if proc.poll() is None: proc.kill() # XXX bug: killing emscripten.py does not kill it's child process! raise Exception("Timed out: " + note) - return proc.communicate()[0] + out = proc.communicate() + return '\n'.join(out) if full_output else out[0] -def run_js(filename, engine=None, args=[], check_timeout=False, stdout=PIPE, stderr=None, cwd=None): +def run_js(filename, engine=None, args=[], check_timeout=False, stdout=PIPE, stderr=None, cwd=None, full_output=False): if engine is None: engine = JS_ENGINES[0] if type(engine) is not list: engine = [engine] command = engine + [filename] + (['--'] if 'd8' in engine[0] else []) + args - return timeout_run(Popen(command, stdout=stdout, stderr=stderr, cwd=cwd), 15*60 if check_timeout else None, 'Execution') + return timeout_run(Popen(command, stdout=stdout, stderr=stderr, cwd=cwd), 15*60 if check_timeout else None, 'Execution', full_output=full_output) def to_cc(cxx): # By default, LLVM_GCC and CLANG are really the C++ versions. This gets an explicit C version |