]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / functionalities / data-formatter / data-formatter-stl / libstdcpp / smart_ptr / TestDataFormatterStdSmartPtr.py
1 """
2 Test lldb data formatter subsystem.
3 """
4
5 from __future__ import print_function
6
7 import os
8 import time
9 import lldb
10 from lldbsuite.test.decorators import *
11 from lldbsuite.test.lldbtest import *
12 from lldbsuite.test import lldbutil
13
14
15 class StdSmartPtrDataFormatterTestCase(TestBase):
16     mydir = TestBase.compute_mydir(__file__)
17
18     @skipIfFreeBSD
19     @skipIfWindows  # libstdcpp not ported to Windows
20     @skipIfDarwin  # doesn't compile on Darwin
21     def test_with_run_command(self):
22         self.build()
23         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
24
25         lldbutil.run_break_set_by_source_regexp(
26             self, "Set break point at this line.")
27         self.runCmd("run", RUN_SUCCEEDED)
28
29         # The stop reason of the thread should be breakpoint.
30         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
31                     substrs=['stopped', 'stop reason = breakpoint'])
32
33         self.expect("frame variable nsp", substrs=['nsp = nullptr'])
34         self.expect("frame variable isp", substrs=['isp = 123'])
35         self.expect("frame variable ssp", substrs=['ssp = "foobar"'])
36
37         self.expect("frame variable nwp", substrs=['nwp = nullptr'])
38         self.expect("frame variable iwp", substrs=['iwp = 123'])
39         self.expect("frame variable swp", substrs=['swp = "foobar"'])
40
41         self.runCmd("continue")
42
43         self.expect("frame variable nsp", substrs=['nsp = nullptr'])
44         self.expect("frame variable isp", substrs=['isp = nullptr'])
45         self.expect("frame variable ssp", substrs=['ssp = nullptr'])
46
47         self.expect("frame variable nwp", substrs=['nwp = nullptr'])
48         self.expect("frame variable iwp", substrs=['iwp = nullptr'])
49         self.expect("frame variable swp", substrs=['swp = nullptr'])