summaryrefslogtreecommitdiff
path: root/test/run-tests.py
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2017-03-31 10:27:39 -0700
committerGitHub <noreply@github.com>2017-03-31 10:27:39 -0700
commit190a98f9e317215b995539e4e4522cac44539d44 (patch)
treec9fe2f9267d5cad96ee9671cec6d025d1d0bdaf0 /test/run-tests.py
parent06839fe4a1ba21e7c596e77c49b0e8126fe0d9b1 (diff)
downloadwabt-190a98f9e317215b995539e4e4522cac44539d44.tar.gz
wabt-190a98f9e317215b995539e4e4522cac44539d44.tar.bz2
wabt-190a98f9e317215b995539e4e4522cac44539d44.zip
Properly handle keyboard interrupt in run-tests.py (#382)
We shouldn't eat Exceptions, just our own local Errors; that way bugs in the test runner propagate out to give us nice stack traces.
Diffstat (limited to 'test/run-tests.py')
-rwxr-xr-xtest/run-tests.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/test/run-tests.py b/test/run-tests.py
index 64a90167..e4765355 100755
--- a/test/run-tests.py
+++ b/test/run-tests.py
@@ -535,13 +535,13 @@ def RunTest(info, options, variables, verbose_level=0):
cmd = info.GetCommand(rel_gen_input_path, variables, options.arg,
verbose_level)
return RunCommandWithTimeout(cmd, cwd, timeout, verbose_level > 0)
- except (Exception, KeyboardInterrupt) as e:
+ except (Error, KeyboardInterrupt) as e:
return e
def HandleTestResult(status, info, result, rebase=False):
try:
- if isinstance(result, Exception):
+ if isinstance(result, (Error, KeyboardInterrupt)):
raise result
stdout, stderr, returncode, duration = result
@@ -570,7 +570,7 @@ def HandleTestResult(status, info, result, rebase=False):
else:
info.Diff(stdout, stderr)
status.Passed(info, duration)
- except Exception as e:
+ except Error as e:
status.Failed(info, str(e))
@@ -623,8 +623,6 @@ def RunMultiThreaded(infos_to_run, status, options, variables):
time.sleep(0.01)
results = new_results
pool.close()
- except KeyboardInterrupt:
- pass
finally:
pool.terminate()
pool.join()