aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-02-01 22:57:42 +0200
committerGitHub <noreply@github.com>2018-02-01 22:57:42 +0200
commit86365d9ac2576f1b4799f37be306f25b2ec47e44 (patch)
tree54a3bda0688d3d3ad9e1067e7fcd9f0bc64b2d9d
parent6cd7372e2693e17ed7f1a2f9af257b21424fa454 (diff)
parent9b27f070026460d07d7b5c0691390c5a4396d09e (diff)
downloadmeson-86365d9ac2576f1b4799f37be306f25b2ec47e44.zip
meson-86365d9ac2576f1b4799f37be306f25b2ec47e44.tar.gz
meson-86365d9ac2576f1b4799f37be306f25b2ec47e44.tar.bz2
Merge pull request #2995 from rhd/fix-2281
-rw-r--r--mesonbuild/mtest.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 2032e05..95e532c 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -241,8 +241,8 @@ class TestHarness:
stdout = subprocess.PIPE
stderr = subprocess.PIPE if self.options and self.options.split else subprocess.STDOUT
- if not is_windows():
- setsid = os.setsid
+ if not is_windows():
+ setsid = os.setsid
p = subprocess.Popen(cmd,
stdout=stdout,
@@ -251,6 +251,7 @@ class TestHarness:
cwd=test.workdir,
preexec_fn=setsid)
timed_out = False
+ kill_test = False
if test.timeout is None:
timeout = None
else:
@@ -261,6 +262,11 @@ class TestHarness:
if self.options.verbose:
print("%s time out (After %d seconds)" % (test.name, timeout))
timed_out = True
+ except KeyboardInterrupt:
+ mlog.warning("CTRL-C detected while running %s" % (test.name))
+ kill_test = True
+
+ if kill_test or timed_out:
# Python does not provide multiplatform support for
# killing a process and all its children so we need
# to roll our own.