diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-06-11 23:26:15 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-06-11 23:26:15 +0000 |
commit | 48f0c2690229bd49fd6cac6df3e33a91fb1ea80a (patch) | |
tree | 5f6303b5bbe1b75361aa798912fc7589674434f0 /lldb | |
parent | c6b96c8db2c1ebf50e8afa5bbfc9d7f4129e40cc (diff) | |
download | bcm5719-llvm-48f0c2690229bd49fd6cac6df3e33a91fb1ea80a.tar.gz bcm5719-llvm-48f0c2690229bd49fd6cac6df3e33a91fb1ea80a.zip |
[Test] Update static variable test.
Before Pavel's change in r334181, we were printing too many global
variables. This patch updates the test suite to ensure we don't regress
again in the future.
rdar://problem/29180927
llvm-svn: 334454
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py index a30d333c5c2..ee4bb3d43b7 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py @@ -39,14 +39,33 @@ 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', VARIABLES_DISPLAYED_CORRECTLY, - patterns=['\(PointType \[[1-9]*\]\) A::g_points = {']) - self.expect('target variable g_points', VARIABLES_DISPLAYED_CORRECTLY, - substrs=['(PointType [2]) g_points']) + 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)' + ]) # On Mac OS X, gcc 4.2 emits the wrong debug info for A::g_points. # A::g_points is an array of two elements. |