From c9cd6c7726df7ee0ca4cb6ecf969d98c50335046 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 29 Oct 2015 16:56:45 -0700 Subject: fix check.py, do not try interpreter if not provided --- check.py | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'check.py') 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! ]' -- cgit v1.2.3