From 252962faba97b68684a470447c7202cf27ad8c05 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 17 Feb 2016 12:52:51 -0800 Subject: add example testcases to auto-updater, and update it --- auto_update_tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'auto_update_tests.py') 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! ]' -- cgit v1.2.3