summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-10-29 16:56:45 -0700
committerAlon Zakai <alonzakai@gmail.com>2015-10-29 16:56:45 -0700
commitc9cd6c7726df7ee0ca4cb6ecf969d98c50335046 (patch)
tree4594bb0d2d93d53c39f826cb1854f74fc8c06829 /check.py
parentd9ae6b3dcccf32a46e92d18105dcf38702e25573 (diff)
downloadbinaryen-c9cd6c7726df7ee0ca4cb6ecf969d98c50335046.tar.gz
binaryen-c9cd6c7726df7ee0ca4cb6ecf969d98c50335046.tar.bz2
binaryen-c9cd6c7726df7ee0ca4cb6ecf969d98c50335046.zip
fix check.py, do not try interpreter if not provided
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py37
1 files changed, 19 insertions, 18 deletions
diff --git a/check.py b/check.py
index ce4066a4c..6466b87f5 100755
--- a/check.py
+++ b/check.py
@@ -39,24 +39,25 @@ for asm in tests:
))
# verify in wasm
- proc = subprocess.Popen([interpreter, os.path.join('test', wasm)], stderr=subprocess.PIPE)
- out, err = proc.communicate()
- if proc.returncode != 0:
- try: # to parse the error
- reported = err.split(':')[1]
- start, end = reported.split('-')
- start_line, start_col = map(int, start.split('.'))
- lines = expected.split('\n')
- print
- print '='*80
- print lines[start_line-1]
- print (' '*(start_col-1)) + '^'
- print (' '*(start_col-1)) + '|'
- print '='*80
- print err
- except Exception, e:
- raise Exception('wasm interpreter error: ' + err) # failed to pretty-print
- raise Exception('wasm interpreter error')
+ if interpreter:
+ proc = subprocess.Popen([interpreter, os.path.join('test', wasm)], stderr=subprocess.PIPE)
+ out, err = proc.communicate()
+ if proc.returncode != 0:
+ try: # to parse the error
+ reported = err.split(':')[1]
+ start, end = reported.split('-')
+ start_line, start_col = map(int, start.split('.'))
+ lines = expected.split('\n')
+ print
+ print '='*80
+ print lines[start_line-1]
+ print (' '*(start_col-1)) + '^'
+ print (' '*(start_col-1)) + '|'
+ print '='*80
+ print err
+ except Exception, e:
+ raise Exception('wasm interpreter error: ' + err) # failed to pretty-print
+ raise Exception('wasm interpreter error')
print '\n[ success! ]'