aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-05-26 21:10:37 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2016-05-26 21:10:37 +0300
commit7dc93276493da068235e5c4775ee05f1e11aa6a9 (patch)
treef2a18941363806b3cf16fff0bd8440ddb1e6c735
parentd08a23c0010fda2dedec507e8705f8ed6ba3e8d7 (diff)
parent4a102fd44566c427edf8862a56c91b434ce44f2c (diff)
downloadmeson-7dc93276493da068235e5c4775ee05f1e11aa6a9.zip
meson-7dc93276493da068235e5c4775ee05f1e11aa6a9.tar.gz
meson-7dc93276493da068235e5c4775ee05f1e11aa6a9.tar.bz2
Cancel all pending test cases when interrupted by signals
-rwxr-xr-xrun_tests.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/run_tests.py b/run_tests.py
index ad2450e..1317380 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -157,7 +157,7 @@ def validate_install(srcdir, installdir):
return ''
def log_text_file(logfile, testdir, stdo, stde):
- global stop
+ global stop, executor, futures
logfile.write('%s\nstdout\n\n---\n' % testdir)
logfile.write(stdo)
logfile.write('\n\n---\n\nstderr\n\n---\n')
@@ -167,6 +167,10 @@ def log_text_file(logfile, testdir, stdo, stde):
print(stdo)
print(stde, file=sys.stderr)
if stop:
+ print("Aborting..")
+ for f in futures:
+ f[2].cancel()
+ executor.shutdown()
raise StopException()
def run_configure_inprocess(commandlist):
@@ -300,7 +304,7 @@ def detect_tests_to_run():
return all_tests
def run_tests(extra_args):
- global passing_tests, failing_tests, stop
+ global passing_tests, failing_tests, stop, executor, futures
all_tests = detect_tests_to_run()
logfile = open('meson-test-run.txt', 'w', encoding="utf_8")
junit_root = ET.Element('testsuites')