summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-01-11 17:16:57 -0500
committerAlon Zakai <alonzakai@gmail.com>2016-01-11 17:16:57 -0500
commit4e98f922cb2d727a319f62d32e51afabb2e46d24 (patch)
tree507db7035fe0557431ff49f55016df1bedff8000 /check.py
parent75a562190a9f4588c8ffb19b8304f76c15a850c6 (diff)
parent873e5b0500a3edb07a09ed285ba8421be375cd25 (diff)
downloadbinaryen-4e98f922cb2d727a319f62d32e51afabb2e46d24.tar.gz
binaryen-4e98f922cb2d727a319f62d32e51afabb2e46d24.tar.bz2
binaryen-4e98f922cb2d727a319f62d32e51afabb2e46d24.zip
Merge pull request #91 from WebAssembly/sanitizers
Add Travis builds with sanitizers
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/check.py b/check.py
index ed43458ef..f3d8b02e0 100755
--- a/check.py
+++ b/check.py
@@ -144,7 +144,9 @@ for t in tests:
if t.endswith('.wast') and not t.startswith('spec'):
print '..', t
t = os.path.join('test', t)
- actual, err = subprocess.Popen([os.path.join('bin', 'binaryen-shell'), t, '-print-before'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
+ cmd = [os.path.join('bin', 'binaryen-shell'), t, '-print-before']
+ print ' ', ' '.join(cmd)
+ actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
assert err.replace('printing before:', '').strip() == '', 'bad err:' + err
actual = actual.replace('printing before:\n', '')
@@ -271,7 +273,12 @@ if unexpected_result_count:
print '\n[ checking example testcases... ]\n'
-subprocess.check_call([os.environ.get('CXX') or 'g++', '-std=c++11', os.path.join('test', 'example', 'find_div0s.cpp'), '-Isrc', '-g', '-lsupport', '-Llib/.'])
+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]
expected = open(os.path.join('test', 'example', 'find_div0s.txt')).read()
if actual != expected: