Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / api / multiple-debuggers / TestMultipleDebuggers.py
blob889784ccc60b6340420188cbf24718fc5af5844a
1 """Test the lldb public C++ api when doing multiple debug sessions simultaneously."""
3 import os
5 import lldb
6 from lldbsuite.test.decorators import *
7 from lldbsuite.test.lldbtest import *
8 from lldbsuite.test import lldbutil
11 class TestMultipleSimultaneousDebuggers(TestBase):
12 NO_DEBUG_INFO_TESTCASE = True
14 @skipIfNoSBHeaders
15 @skipIfWindows
16 def test_multiple_debuggers(self):
17 env = {self.dylibPath: self.getLLDBLibraryEnvVal()}
19 # We need this in order to run under ASAN, in case only LLDB is ASANified.
20 asan_options = os.getenv("ASAN_OPTIONS", None)
21 if asan_options is not None:
22 env["ASAN_OPTIONS"] = asan_options
24 self.driver_exe = self.getBuildArtifact("multi-process-driver")
25 self.buildDriver("multi-process-driver.cpp", self.driver_exe)
26 self.addTearDownHook(lambda: os.remove(self.driver_exe))
27 self.signBinary(self.driver_exe)
29 self.inferior_exe = self.getBuildArtifact("testprog")
30 self.buildDriver("testprog.cpp", self.inferior_exe)
31 self.addTearDownHook(lambda: os.remove(self.inferior_exe))
33 # check_call will raise a CalledProcessError if multi-process-driver
34 # doesn't return exit code 0 to indicate success. We can let this
35 # exception go - the test harness will recognize it as a test failure.
37 if self.TraceOn():
38 print("Running test %s" % self.driver_exe)
39 check_call([self.driver_exe, self.inferior_exe], env=env)
40 else:
41 with open(os.devnull, "w") as fnull:
42 check_call(
43 [self.driver_exe, self.inferior_exe],
44 env=env,
45 stdout=fnull,
46 stderr=fnull,