]> 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 release_39 branch r276489:
[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, time
8 import lldb
9 from lldbsuite.test.decorators import *
10 from lldbsuite.test.lldbtest import *
11 from lldbsuite.test import lldbutil
12
13 class StdSmartPtrDataFormatterTestCase(TestBase):
14     mydir = TestBase.compute_mydir(__file__)
15
16     @skipIfFreeBSD
17     @skipIfWindows # libstdcpp not ported to Windows
18     @skipIfDarwin # doesn't compile on Darwin
19     def test_with_run_command(self):
20         self.build()
21         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
22
23         lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")
24         self.runCmd("run", RUN_SUCCEEDED)
25
26         # The stop reason of the thread should be breakpoint.
27         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
28             substrs = ['stopped', 'stop reason = breakpoint'])
29
30         self.expect("frame variable nsp", substrs = ['nsp = nullptr'])
31         self.expect("frame variable isp", substrs = ['isp = 123'])
32         self.expect("frame variable ssp", substrs = ['ssp = "foobar"'])
33
34         self.expect("frame variable nwp", substrs = ['nwp = nullptr'])
35         self.expect("frame variable iwp", substrs = ['iwp = 123'])
36         self.expect("frame variable swp", substrs = ['swp = "foobar"'])
37         
38         self.runCmd("continue")
39
40         self.expect("frame variable nsp", substrs = ['nsp = nullptr'])
41         self.expect("frame variable isp", substrs = ['isp = nullptr'])
42         self.expect("frame variable ssp", substrs = ['ssp = nullptr'])
43
44         self.expect("frame variable nwp", substrs = ['nwp = nullptr'])
45         self.expect("frame variable iwp", substrs = ['iwp = nullptr'])
46         self.expect("frame variable swp", substrs = ['swp = nullptr'])