2 Test DarwinLog "source include info-level" functionality provided by the
3 StructuredDataDarwinLog plugin.
5 These tests are currently only supported when running against Darwin
12 from lldbsuite.test import decorators
13 from lldbsuite.test import lldbtest
14 from lldbsuite.test import darwin_log
17 class TestDarwinLogSourceInfo(darwin_log.DarwinLogTestBase):
19 mydir = lldbtest.TestBase.compute_mydir(__file__)
22 # Call super's setUp().
23 super(TestDarwinLogSourceInfo, self).setUp()
26 self.source = 'main.c'
29 self.exe_name = self.getBuildArtifact("a.out")
30 self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
33 self.line = lldbtest.line_number(self.source, '// break here')
35 # Indicate we want strict-sources behavior.
36 self.strict_sources = True
39 # Shut down the process if it's still running.
41 self.runCmd('process kill')
46 super(TestDarwinLogSourceInfo, self).tearDown()
48 # ==========================================================================
49 # source include/exclude debug filter tests
50 # ==========================================================================
52 @decorators.skipUnlessDarwin
53 @decorators.expectedFailureAll(bugnumber="rdar://27316264")
54 def test_source_exclude_info_level(self):
55 """Test that default excluding of info-level log messages works."""
58 # We should only see the second log message as the first is an
59 # info-level message and we're not including debug-level messages.
60 self.assertIsNotNone(self.child.match)
63 self.child.match.groups()) > 1) and (
64 self.child.match.group(2) == "cat2"),
65 "first log line should not be present, second log line "
68 @decorators.skipUnlessDarwin
69 def test_source_include_info_level(self):
70 """Test that explicitly including info-level log messages works."""
75 # We should only see the second log message as the first is a
76 # debug-level message and we're not including debug-level messages.
77 self.assertIsNotNone(self.child.match)
78 self.assertTrue((len(self.child.match.groups()) > 1) and
79 (self.child.match.group(2) == "cat1"),
80 "first log line should be present since we're "
81 "including info-level log messages")