diff options
-rwxr-xr-x | auto_update_tests.py | 11 | ||||
-rw-r--r-- | test/example/find_div0s.txt | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py index 57709b7f7..11d437360 100755 --- a/auto_update_tests.py +++ b/auto_update_tests.py @@ -71,4 +71,15 @@ for wast in sorted(os.listdir('test')): actual = open('a.wast').read() open(os.path.join('test', wast + '.fromBinary'), 'w').write(actual) +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/.'] +if os.environ.get('COMPILER_FLAGS'): + for f in os.environ.get('COMPILER_FLAGS').split(' '): + cmd.append(f) +print ' '.join(cmd) +subprocess.check_call(cmd) +actual = subprocess.Popen(['./a.out'], stdout=subprocess.PIPE).communicate()[0] +open(os.path.join('test', 'example', 'find_div0s.txt'), 'w').write(actual) + print '\n[ success! ]' diff --git a/test/example/find_div0s.txt b/test/example/find_div0s.txt index 554790493..756de10c5 100644 --- a/test/example/find_div0s.txt +++ b/test/example/find_div0s.txt @@ -1,5 +1,5 @@ (module - (memory 0 4294967295) + (memory 0) (func $has_div_zero (i32.div_s (i32.const 5) |