4c3935c851c5e127694340191b46fcd3e9df6c63
[openbsd] /
1 # encoding: utf-8
2
3 import lldb
4 from lldbsuite.test.decorators import *
5 from lldbsuite.test.lldbtest import *
6 from lldbsuite.test import lldbutil
7
8
9 class CMTimeDataFormatterTestCase(TestBase):
10
11     mydir = TestBase.compute_mydir(__file__)
12
13     @skipUnlessDarwin
14     def test_nsindexpath_with_run_command(self):
15         """Test formatters for CMTime."""
16         self.build()
17         self.runCmd("file " + self.getBuildArtifact("a.out"),
18                     CURRENT_EXECUTABLE_SET)
19
20         line = line_number('main.m', '// break here')
21         lldbutil.run_break_set_by_file_and_line(
22             self, "main.m", line, num_expected_locations=1, loc_exact=True)
23
24         self.runCmd("run", RUN_SUCCEEDED)
25
26         self.expect(
27             "thread list",
28             STOPPED_DUE_TO_BREAKPOINT,
29             substrs=['stopped', 'stop reason = breakpoint'])
30
31         self.expect(
32             'frame variable t1',
33             substrs=[
34                 '1 10th of a second', 'value = 1', 'timescale = 10',
35                 'epoch = 0'
36             ])
37         self.expect(
38             'frame variable t2',
39             substrs=['10 seconds', 'value = 10', 'timescale = 1', 'epoch = 0'])