summaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/lang/cpp/class_static
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
commitf73363f1dd94996356cefbf24388f561891acf0b (patch)
treee3c31248bdb36eaec5fd833490d4278162dba2a0 /packages/Python/lldbsuite/test/lang/cpp/class_static
parent160ee69dd7ae18978f4068116777639ea98dc951 (diff)
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/lang/cpp/class_static')
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py52
1 files changed, 49 insertions, 3 deletions
diff --git a/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py b/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
index d167f0a5591d0..97b0bfd8aee06 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
@@ -27,7 +27,7 @@ class StaticVariableTestCase(TestBase):
def test_with_run_command(self):
"""Test that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
@@ -39,7 +39,7 @@ class StaticVariableTestCase(TestBase):
substrs=['stopped',
'stop reason = breakpoint'])
- # global variables are no longer displayed with the "frame variable"
+ # Global variables are no longer displayed with the "frame variable"
# command.
self.expect(
'target variable A::g_points',
@@ -63,11 +63,57 @@ class StaticVariableTestCase(TestBase):
compiler=["clang"],
compiler_version=["<", "3.9"],
bugnumber='llvm.org/pr20550')
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
+ def test_with_run_command_complete(self):
+ """
+ Test that file and class static variables display correctly with
+ complete debug information.
+ """
+ self.build()
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
+ self.assertTrue(target, VALID_TARGET)
+
+ # Global variables are no longer displayed with the "frame variable"
+ # command.
+ self.expect(
+ 'target variable A::g_points',
+ VARIABLES_DISPLAYED_CORRECTLY,
+ patterns=[
+ '\(PointType \[[1-9]*\]\) A::g_points = {', '(x = 1, y = 2)',
+ '(x = 11, y = 22)'
+ ])
+
+ # Ensure that we take the context into account and only print
+ # A::g_points.
+ self.expect(
+ 'target variable A::g_points',
+ VARIABLES_DISPLAYED_CORRECTLY,
+ matching=False,
+ patterns=['(x = 3, y = 4)', '(x = 33, y = 44)'])
+
+ # Finally, ensure that we print both points when not specifying a
+ # context.
+ self.expect(
+ 'target variable g_points',
+ VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=[
+ '(PointType [2]) g_points', '(x = 1, y = 2)',
+ '(x = 11, y = 22)', '(x = 3, y = 4)', '(x = 33, y = 44)'
+ ])
+
+ @expectedFailureAll(
+ compiler=["gcc"],
+ bugnumber="Compiler emits incomplete debug info")
+ @expectedFailureAll(
+ compiler=["clang"],
+ compiler_version=["<", "3.9"],
+ bugnumber='llvm.org/pr20550')
@add_test_categories(['pyapi'])
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
def test_with_python_api(self):
"""Test Python APIs on file and class static variables."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)