summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2019-03-28 15:31:51 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2019-03-28 15:47:31 +1000
commit56dfa2f6c0aee38e194ec12fdcdf886d5b16e825 (patch)
treed449ba18ce8bf1fd4119f9ab49b3c6dc902dcdec
parent79293ea4562ad55bf0703d39fc91493f6dd8cb5b (diff)
test: fix tool option parsing tests for signals
Not sure how this ever worked correctly: a process terminated by a signal has the negative signo as return code. This would apply to every debug-events and debug-gui test because they have to get killed by a signal. This failed occasionally, presumably a race with the GTK startup/signal handler/whatever. Fix this by a) sending SIGQUIT because that won't get handled by the tools and b) prending that if we get a -SIGQUIT exit code, everything is fine. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rwxr-xr-xtools/test-tool-option-parsing.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/test-tool-option-parsing.py b/tools/test-tool-option-parsing.py
index c68992e0..ede9a077 100755
--- a/tools/test-tool-option-parsing.py
+++ b/tools/test-tool-option-parsing.py
@@ -42,8 +42,10 @@ class TestLibinputTool(unittest.TestCase):
with subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p:
time.sleep(0.1)
- p.send_signal(2)
+ p.send_signal(3) # SIGQUIT
p.wait()
+ if p.returncode == -3:
+ p.returncode = 0
return p.returncode, p.stdout.read().decode('UTF-8'), p.stderr.read().decode('UTF-8')
def run_command_success(self, args):