From 6512f29a40c72979c05e73318b957e425363980e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 31 Oct 2015 15:48:08 -0700 Subject: prepare for polyfill testing --- check.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'check.py') diff --git a/check.py b/check.py index 6466b87f5..c6b6090f2 100755 --- a/check.py +++ b/check.py @@ -16,7 +16,7 @@ for arg in sys.argv[1:]: if not interpreter: print '[ no wasm interpreter provided, you should pass one as --interpreter=path/to/interpreter ]' -print '[ checking testcases... ]\n' +print '[ checking asm2wasm testcases... ]\n' if len(tests) == 0: tests = sorted(os.listdir('test')) @@ -59,5 +59,16 @@ for asm in tests: raise Exception('wasm interpreter error: ' + err) # failed to pretty-print raise Exception('wasm interpreter error') +print '\n[ checking emcc_to_polyfill testcases... (need both emcc and nodejs in your path) ]\n' + +print '..normal' + +if os.path.exists('a.normal.js'): os.unlink('a.normal.js') +subprocess.check_call(['./emcc_to_polyfill.sh', os.path.join('test', 'hello_world.c')]) +proc = subprocess.Popen(['nodejs', 'a.normal.js'], stdout=subprocess.PIPE) +out, err = proc.communicate() +assert proc.returncode == 0 +assert 'hello, world!' in out, out + print '\n[ success! ]' -- cgit v1.2.3