39 lines · python
1"""Test the lldb public C++ api when doing multiple debug sessions simultaneously."""2 3import os4import subprocess5 6import lldb7from lldbsuite.test.decorators import *8from lldbsuite.test.lldbtest import *9from lldbsuite.test import lldbutil10 11 12class TestMultipleSimultaneousDebuggers(TestBase):13 NO_DEBUG_INFO_TESTCASE = True14 15 # Times out on heavily loaded Linux buildbots, don't want to get into tweaking16 # the timeout per bot. Does work when run alone. See:17 # https://github.com/llvm/llvm-project/issues/10116218 @skipIfLinux19 @skipIfNoSBHeaders20 @skipIfWindows21 @skipIfHostIncompatibleWithTarget22 def test_multiple_debuggers(self):23 self.driver_exe = self.getBuildArtifact("multi-process-driver")24 self.buildDriver(25 "multi-process-driver.cpp",26 self.driver_exe,27 defines=[("LLDB_HOST_ARCH", lldbplatformutil.getArchitecture())],28 )29 self.addTearDownHook(lambda: os.remove(self.driver_exe))30 31 self.inferior_exe = self.getBuildArtifact("testprog")32 self.buildDriver("testprog.cpp", self.inferior_exe)33 self.addTearDownHook(lambda: os.remove(self.inferior_exe))34 35 # check_call will raise a CalledProcessError if the executable doesn't36 # return exit code 0 to indicate success. We can let this exception go37 # - the test harness will recognize it as a test failure.38 subprocess.check_call([self.driver_exe, self.inferior_exe])39