aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-17 17:58:25 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-17 17:58:25 -0700
commit217ab28dc4fdc0ae52af3c0659fc81e03af0f274 (patch)
tree8484fd371c5e201f671196d6af4c420795abc573
parent18a051bace964892dc1315b4b2884253e061d769 (diff)
add EM_DEBUG option for test runner printouts of run_js
-rw-r--r--tools/shared.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 6f168a36..fb41f7ee 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -267,11 +267,14 @@ def timeout_run(proc, timeout, note='unnamed process'):
raise Exception("Timed out: " + note)
return proc.communicate()[0]
+EM_DEBUG = os.environ.get('EM_DEBUG')
+
def run_js(filename, engine=None, args=[], check_timeout=False, stdout=PIPE, stderr=None, cwd=None):
if engine is None: engine = JS_ENGINES[0]
if type(engine) is not list: engine = [engine]
- return timeout_run(Popen(engine + [filename] + (['--'] if 'd8' in engine[0] else []) + args,
- stdout=stdout, stderr=stderr, cwd=cwd), 15*60 if check_timeout else None, 'Execution')
+ command = engine + [filename] + (['--'] if 'd8' in engine[0] else []) + args
+ if EM_DEBUG: print >> sys.stderr, 'run_js: ' + ' '.join(command)
+ return timeout_run(Popen(command, stdout=stdout, stderr=stderr, cwd=cwd), 15*60 if check_timeout else None, 'Execution')
def to_cc(cxx):
# By default, LLVM_GCC and CLANG are really the C++ versions. This gets an explicit C version