diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-15 13:10:55 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-15 13:10:55 -0800 |
commit | c05d19aef2eaeef7743c7ba574e71de786519d1b (patch) | |
tree | 4d1b493bb716c09df0db4b539ca17a9e8619f69b /tests/runner.py | |
parent | c47f7eba9be951c8e308e66c2541091c6b057af8 (diff) | |
parent | a21017cfe7ca199a6a51511ee65aea63f011446b (diff) |
Merge branch 'incoming'
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/tests/runner.py b/tests/runner.py index d3471f62..6e76d061 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -276,6 +276,11 @@ process(sys.argv[1]) os.chdir(cwd) out = open(stdout, 'r').read() err = open(stderr, 'r').read() + if engine == SPIDERMONKEY_ENGINE and Settings.ASM_JS: + if 'Successfully compiled asm.js code' in err and 'asm.js link error' not in err: + print >> sys.stderr, "[was asm.js'ified]" + else: + print >> sys.stderr, "[did NOT asm.js'ify]" if output_nicerizer: ret = output_nicerizer(out, err) else: @@ -2316,8 +2321,8 @@ Exception execution path of first function! 1 self.do_run(src, '*throw...caught!infunc...done!*') Settings.DISABLE_EXCEPTION_CATCHING = 1 - self.do_run(src, 'Compiled code throwing an exception') - + self.do_run(src, 'Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 to catch.') + src = ''' #include <iostream> @@ -3347,6 +3352,15 @@ def process(filename): ''' self.do_run(src, '*96,97,98,-14,-14,101*') + def test_bigswitch(self): + if Settings.RELOOP: return self.skip('TODO: switch in relooper, issue #781') + + src = open(path_from_root('tests', 'bigswitch.cpp')).read() + self.do_run(src, '''34962: GL_ARRAY_BUFFER (0x8892) +26214: what? +35040: GL_STREAM_DRAW (0x88E0) +''', args=['34962', '26214', '35040']) + def test_indirectbr(self): src = ''' #include <stdio.h> @@ -8980,11 +8994,11 @@ f.close() (path_from_root('tools', 'eliminator', 'safe-eliminator-test.js'), open(path_from_root('tools', 'eliminator', 'safe-eliminator-test-output.js')).read(), ['eliminateMemSafe']), (path_from_root('tools', 'eliminator', 'asm-eliminator-test.js'), open(path_from_root('tools', 'eliminator', 'asm-eliminator-test-output.js')).read(), - ['eliminateAsm']), + ['asm', 'eliminate']), (path_from_root('tools', 'test-js-optimizer-asm-regs.js'), open(path_from_root('tools', 'test-js-optimizer-asm-regs-output.js')).read(), - ['registerizeAsm']), + ['asm', 'registerize']), (path_from_root('tools', 'test-js-optimizer-asm-pre.js'), open(path_from_root('tools', 'test-js-optimizer-asm-pre-output.js')).read(), - ['simplifyExpressionsPreAsm']), + ['asm', 'simplifyExpressionsPre']), ]: output = Popen([NODE_JS, path_from_root('tools', 'js-optimizer.js'), input] + passes, stdin=PIPE, stdout=PIPE).communicate()[0] self.assertIdentical(expected, output.replace('\r\n', '\n').replace('\n\n', '\n')) @@ -10549,7 +10563,7 @@ elif 'benchmark' in str(sys.argv): times = [] for i in range(TEST_REPS): start = time.time() - js_output = self.run_generated_code(JS_ENGINE, final_filename, args, check_timeout=False) + js_output = run_js(final_filename, engine=JS_ENGINE, args=args, stderr=PIPE, full_output=True) if i == 0 and 'Successfully compiled asm.js code' in js_output: print "[%s was asm.js'ified]" % name curr = time.time()-start |