diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-10-29 16:56:45 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-10-29 16:56:45 -0700 |
commit | c9cd6c7726df7ee0ca4cb6ecf969d98c50335046 (patch) | |
tree | 4594bb0d2d93d53c39f826cb1854f74fc8c06829 /check.py | |
parent | d9ae6b3dcccf32a46e92d18105dcf38702e25573 (diff) | |
download | binaryen-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-x | check.py | 37 |
1 files changed, 19 insertions, 18 deletions
@@ -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! ]' |