diff options
Diffstat (limited to 'check.py')
-rwxr-xr-x | check.py | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -280,16 +280,26 @@ if torture: if unexpected_result_count: fail(unexpected_result_count, 0) -print '\n[ checking wasm-as testcases... ]\n' +print '\n[ checking binary format testcases... ]\n' for wast in tests: if wast.endswith('.wast') and not wast in ['unit.wast']: # blacklist some known failures cmd = [os.path.join('bin', 'wasm-as'), os.path.join('test', wast), '-o', 'a.wasm'] - print cmd + print ' '.join(cmd) if os.path.exists('a.wasm'): os.unlink('a.wasm') subprocess.check_call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) assert os.path.exists('a.wasm') + cmd = [os.path.join('bin', 'wasm-dis'), 'a.wasm', '-o', 'a.wast'] + print ' '.join(cmd) + if os.path.exists('a.wast'): os.unlink('a.wast') + subprocess.check_call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + assert os.path.exists('a.wast') + expected = open(os.path.join('test', wast + '.fromBinary')).read() + actual = open('a.wast').read() + if actual != expected: + fail(actual, expected) + print '\n[ checking example testcases... ]\n' cmd = [os.environ.get('CXX') or 'g++', '-std=c++11', os.path.join('test', 'example', 'find_div0s.cpp'), '-Isrc', '-g', '-lsupport', '-Llib/.'] |