tools: we don't need a core file for failed option parser tests

SIGQUIT which we send to any successful test of libinput debug-event will
trigger a coredump. We don't need that one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-05-01 10:46:20 +10:00
parent dd96d6b900
commit d7b1ebef4b

View file

@ -26,6 +26,7 @@
import argparse
import os
import unittest
import resource
import sys
import subprocess
import time
@ -35,12 +36,16 @@ class TestLibinputTool(unittest.TestCase):
libinput_tool = 'libinput'
subtool = None
def _disable_coredump(self):
resource.setrlimit(resource.RLIMIT_CORE, (0, 0))
def run_command(self, args):
args = [self.libinput_tool] + args
if self.subtool is not None:
args.insert(1, self.subtool)
with subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p:
with subprocess.Popen(args, preexec_fn=self._disable_coredump,
stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p:
try:
p.wait(0.7)
except subprocess.TimeoutExpired: