summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-11-01 15:39:04 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-11-01 15:39:04 -0800
commitb2e067893efbe22132b210d5af9026b7bd59c270 (patch)
treed732657c9b2e0136279e3323bbabda8d4bb4e3f0 /check.py
parent44e83f2fb039a38b0764a172aa7c64ec3290d8c5 (diff)
downloadbinaryen-b2e067893efbe22132b210d5af9026b7bd59c270.tar.gz
binaryen-b2e067893efbe22132b210d5af9026b7bd59c270.tar.bz2
binaryen-b2e067893efbe22132b210d5af9026b7bd59c270.zip
fix do-while loops
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/check.py b/check.py
index 018f5977d..ade77f0af 100755
--- a/check.py
+++ b/check.py
@@ -79,19 +79,22 @@ for c in tests:
if os.path.exists(emcc):
extra = json.loads(open(emcc).read())
if os.path.exists('a.normal.js'): os.unlink('a.normal.js')
- subprocess.check_call(['./emcc_to_wasm.js.sh', os.path.join('test', c)] + extra, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- if post:
- open('a.normal.js', 'a').write(post)
- open('a.wasm.js', 'a').write(post)
- else:
- print ' (no post)'
- for which in ['normal', 'wasm']:
- print '....', which
- proc = subprocess.Popen(['nodejs', 'a.' + which + '.js'], stdout=subprocess.PIPE)
- out, err = proc.communicate()
- assert proc.returncode == 0
- if out.strip() != expected.strip():
- fail(out, expected)
+ for opts in [[], ['-O1'], ['-O3', '--profiling']]:
+ command = ['./emcc_to_wasm.js.sh', os.path.join('test', c)] + opts + extra
+ subprocess.check_call(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ print '....' + ' '.join(command)
+ if post:
+ open('a.normal.js', 'a').write(post)
+ open('a.wasm.js', 'a').write(post)
+ else:
+ print ' (no post)'
+ for which in ['normal', 'wasm']:
+ print '......', which
+ proc = subprocess.Popen(['nodejs', 'a.' + which + '.js'], stdout=subprocess.PIPE)
+ out, err = proc.communicate()
+ assert proc.returncode == 0
+ if out.strip() != expected.strip():
+ fail(out, expected)
print '\n[ success! ]'