diff options
author | max99x <max99x@gmail.com> | 2011-07-07 10:38:35 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-07-07 12:24:09 +0300 |
commit | 7dcdb044d329babc697363eb1652d8e65f17c699 (patch) | |
tree | b523f3eedaea0e89bce0f03bc0b0b1d8cee07c18 /tests/runner.py | |
parent | d94b2423aef4593ce2b07725e992b7eb25d5f34c (diff) |
Rewrite of emscripten.py:
* Uses option arguments instead of positional ones.
* Allows linking to dlmalloc.
* Accepts both .bc and .ll files and takes care of annotations.
* Allows running the LLVM optimization pass automatically.
* Updated test runner to use the new emscripten.py interface.
Refactoring:
* Moved settings.py to root folder. It no longer applies just to tests.
* Updated references to settings.py.
* Added an __init__.py to tools, so we don't have to hack around imports.
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/runner.py b/tests/runner.py index beef1823..c1ce67ff 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -5,7 +5,7 @@ See settings.py file for options¶ms. Edit as needed. ''' from subprocess import Popen, PIPE, STDOUT -import os, unittest, tempfile, shutil, time, inspect, sys, math, glob, tempfile, re +import os, unittest, tempfile, shutil, time, inspect, sys, math, glob, tempfile, re, json # Setup @@ -19,7 +19,7 @@ exec(open(path_from_root('tools', 'shared.py'), 'r').read()) try: assert COMPILER_OPTS != None except: - raise Exception('Cannot find "COMPILER_OPTS" definition. Is ~/.emscripten set up properly? You may need to copy the template at ~/tests/settings.py into it.') + raise Exception('Cannot find "COMPILER_OPTS" definition. Is ~/.emscripten set up properly? You may need to copy the template from settings.py into it.') # Paths @@ -246,7 +246,8 @@ class RunnerCore(unittest.TestCase): exported_settings[setting] = value except: pass - compiler_output = timeout_run(Popen([EMSCRIPTEN, filename + '.o.ll', str(exported_settings).replace("'", '"'), filename + '.o.js'], stdout=PIPE, stderr=STDOUT), TIMEOUT, 'Compiling') + settings = ['%s=%s' % (k, json.dumps(v)) for k, v in exported_settings.items()] + compiler_output = timeout_run(Popen([EMSCRIPTEN, filename + '.o.ll', '-o', filename + '.o.js', '-s'] + settings, stdout=PIPE, stderr=STDOUT), TIMEOUT, 'Compiling') # Detect compilation crashes and errors if compiler_output is not None and 'Traceback' in compiler_output and 'in test_' in compiler_output: print compiler_output; assert 0 |