aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-24 19:12:49 -0700
committeralon@honor <none@none>2010-10-24 19:12:49 -0700
commit1522f18aab92cfa3e9a58e1eefc40aefcfdc946c (patch)
treeb18a677afe96f1147b810af48c0c624d5b7680da /tests/runner.py
parent58ce4fae9a0aef99dee70643e15e8cea8e5d5c71 (diff)
bullet test
Diffstat (limited to 'tests/runner.py')
-rw-r--r--tests/runner.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 797a21b5..8191d725 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -68,12 +68,15 @@ class RunnerCore(unittest.TestCase):
# LLVM binary ==> LLVM assembly
output = Popen([LLVM_DIS, filename + '.o'] + LLVM_DIS_OPTS + ['-o=' + filename + '.o.ll'], stdout=PIPE, stderr=STDOUT).communicate()[0]
+ self.do_emscripten(filename, output_processor)
+
+ def do_emscripten(self, filename, output_processor=None):
# Run Emscripten
exported_settings = {}
for setting in ['QUANTUM_SIZE', 'RELOOP', 'OPTIMIZE', 'GUARD_MEMORY', 'USE_TYPED_ARRAYS']:
exported_settings[setting] = eval(setting)
out = open(filename + '.o.js', 'w') if not OUTPUT_TO_SCREEN else None
- timeout_run(Popen([EMSCRIPTEN, filename + '.o.ll', COMPILER_ENGINE[0], str(exported_settings).replace("'", '"')], stdout=out, stderr=STDOUT), 240, 'Compiling')
+ timeout_run(Popen([EMSCRIPTEN, filename + '.o.ll', COMPILER_ENGINE[0], str(exported_settings).replace("'", '"')], stdout=out, stderr=STDOUT), TIMEOUT, 'Compiling')
output = open(filename + '.o.js').read()
if output_processor is not None:
output_processor(output)
@@ -102,7 +105,7 @@ if 'benchmark' not in sys.argv:
dirname = self.get_dir()
filename = os.path.join(dirname, 'src.cpp')
if not no_build:
- self.build(src, dirname, filename, output_processor, main_file)
+ self.build(src, dirname, filename, main_file=main_file)
# Run in both JavaScript engines, if optimizing - significant differences there (typed arrays)
engines = [V8_ENGINE] if not OPTIMIZE else [V8_ENGINE, SPIDERMONKEY_ENGINE]
@@ -971,6 +974,18 @@ if 'benchmark' not in sys.argv:
def test_gcc_unmangler(self):
self.do_test(path_from_root(['third_party']), '*d_demangle(char const*, int, unsigned int*)*', args=['_ZL10d_demanglePKciPj'], main_file='gcc_demangler.c')
+ def test_bullet(self):
+ if COMPILER != LLVM_GCC: return # Only support that for now, FIXME
+ if OPTIMIZE: return # TODO
+
+ # No building - just process an existing .ll file
+ filename = os.path.join(self.get_dir(), 'src.cpp')
+ shutil.copy(path_from_root(['tests', 'bullet', 'bulletTest.ll']), filename + '.o.ll')
+ self.do_emscripten(filename)
+ self.do_test(path_from_root(['third_party']),
+ open(path_from_root(['tests', 'bullet', 'output.txt']), 'r').read(),
+ no_build=True)
+
# Generate tests for all our compilers
def make_test(compiler, embetter):
class TT(T):