summaryrefslogtreecommitdiff
path: root/auto_update_tests.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-02-17 12:52:51 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-02-17 12:52:51 -0800
commit252962faba97b68684a470447c7202cf27ad8c05 (patch)
treefdbf3ffff8fe77a8a67aa5b37948c11b0b23e778 /auto_update_tests.py
parentf1f7875381b8407f926c805eb71810bc9a5729f1 (diff)
downloadbinaryen-252962faba97b68684a470447c7202cf27ad8c05.tar.gz
binaryen-252962faba97b68684a470447c7202cf27ad8c05.tar.bz2
binaryen-252962faba97b68684a470447c7202cf27ad8c05.zip
add example testcases to auto-updater, and update it
Diffstat (limited to 'auto_update_tests.py')
-rwxr-xr-xauto_update_tests.py11
1 files changed, 11 insertions, 0 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! ]'