aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-07 20:03:47 -0700
committeralon@honor <none@none>2010-10-07 20:03:47 -0700
commit4de0755572570e6de83788998e8288724b45b2fa (patch)
treea5e542160f822430120db6444a5eb3a7d08a2d4d /tests/runner.py
parent240d161bf89cacbe09f1fcd9afed929c4489a38a (diff)
separate running stage out in test runner
Diffstat (limited to 'tests/runner.py')
-rw-r--r--tests/runner.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 4989b74b..2ce216f5 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -68,6 +68,9 @@ class T(unittest.TestCase):
output_processor(output)
if output is not None and 'Traceback' in output: print output; assert 0
+ def run_generated_code(self, filename, args=[]):
+ return timeout_run(Popen([JS_ENGINE] + JS_ENGINE_OPTS + [filename] + args, stdout=PIPE, stderr=STDOUT), 120, 'Execution')
+
## Does a complete test - builds, runs, checks output, etc.
def do_test(self, src, expected_output, args=[], output_nicerizer=None, output_processor=None, no_build=False, main_file=None):
if not no_build:
@@ -80,7 +83,7 @@ class T(unittest.TestCase):
self.build(src, dirname, filename, output_processor, main_file)
# Run
- js_output = timeout_run(Popen([JS_ENGINE] + JS_ENGINE_OPTS + [filename + '.o.js'] + args, stdout=PIPE, stderr=STDOUT), 120, 'Execution')
+ js_output = self.run_generated_code(filename + '.o.js', args)
if output_nicerizer is not None:
js_output = output_nicerizer(js_output)
self.assertContained(expected_output, js_output)