aboutsummaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
authorNicolas Schneider <nioncode+git@gmail.com>2016-05-25 23:35:18 +0200
committerNicolas Schneider <nioncode+git@gmail.com>2016-05-25 23:38:15 +0200
commit4a102fd44566c427edf8862a56c91b434ce44f2c (patch)
treef5989047f9f99fb883db49cf394ed059a3a91446 /run_tests.py
parent7aa24c7d0a68959e4d29c41d157ee30ff97153ad (diff)
downloadmeson-4a102fd44566c427edf8862a56c91b434ce44f2c.zip
meson-4a102fd44566c427edf8862a56c91b434ce44f2c.tar.gz
meson-4a102fd44566c427edf8862a56c91b434ce44f2c.tar.bz2
cancel all pending test cases when interrupted by signals
Diffstat (limited to 'run_tests.py')
-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')