diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-10-29 19:58:09 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-10-29 19:58:09 -0700 |
commit | 88b6549b74dd767733cd823de410e00067a79756 (patch) | |
tree | 8cb4c94ed220e5cb98e9a2324998747848815bd7 | |
parent | c9b8b17f6f5d01511bcfd511bfda28584533b467 (diff) | |
download | binaryen-88b6549b74dd767733cd823de410e00067a79756.tar.gz binaryen-88b6549b74dd767733cd823de410e00067a79756.tar.bz2 binaryen-88b6549b74dd767733cd823de410e00067a79756.zip |
add test auto updater
-rwxr-xr-x | auto_update_tests.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py new file mode 100755 index 000000000..4b8602c7c --- /dev/null +++ b/auto_update_tests.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +import os, sys, subprocess, difflib + +print '[ processing and updating testcases... ]\n' + +for asm in sorted(os.listdir('test')): + if asm.endswith('.asm.js'): + print '..', asm + wasm = asm.replace('.asm.js', '.wast') + actual, err = subprocess.Popen([os.path.join('bin', 'asm2wasm'), os.path.join('test', asm)], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + assert err == '', 'bad err:' + err + + # verify output + if not os.path.exists(os.path.join('test', wasm)): + print actual + raise Exception('output .wast file does not exist') + open(os.path.join('test', wasm), 'w').write(actual) + +print '\n[ success! ]' + |