1 """Test that importing modules in Objective-C works as expected."""
6 from lldbsuite
.test
.decorators
import *
7 from lldbsuite
.test
.lldbtest
import *
8 from lldbsuite
.test
import lldbutil
11 class ObjCModulesAutoImportTestCase(TestBase
):
13 # Call super's setUp().
15 # Find the line number to break inside main().
16 self
.line
= line_number("main.m", "// Set breakpoint 0 here.")
18 @skipIf(macos_version
=["<", "10.12"])
21 exe
= self
.getBuildArtifact("a.out")
22 self
.runCmd("file " + exe
, CURRENT_EXECUTABLE_SET
)
24 # Break inside the foo function which takes a bar_ptr argument.
25 lldbutil
.run_break_set_by_file_and_line(
26 self
, "main.m", self
.line
, num_expected_locations
=1, loc_exact
=True
29 self
.runCmd("run", RUN_SUCCEEDED
)
31 # The stop reason of the thread should be breakpoint.
34 STOPPED_DUE_TO_BREAKPOINT
,
35 substrs
=["stopped", "stop reason = breakpoint"],
38 # The breakpoint should have a hit count of 1.
39 lldbutil
.check_breakpoint(self
, bpno
=1, expected_hit_count
=1)
41 self
.runCmd("settings set target.auto-import-clang-modules true")
44 "expression getpid()", VARIABLES_DISPLAYED_CORRECTLY
, substrs
=["pid_t"]