summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-04-12 12:32:58 +0000
committerPavel Labath <labath@google.com>2017-04-12 12:32:58 +0000
commitf0565cc84ab12faf5432d20e927a3ded7ea09e55 (patch)
tree97910fed768cfc14699b3db5dcaa2f79f2fb4c42 /lldb/packages/Python/lldbsuite
parent9b4875434efcebd42f83007a9c719ecac5b9cd77 (diff)
downloadbcm5719-llvm-f0565cc84ab12faf5432d20e927a3ded7ea09e55.tar.gz
bcm5719-llvm-f0565cc84ab12faf5432d20e927a3ded7ea09e55.zip
Add libc++ category to the remaining libc++ data formatters
llvm-svn: 300054
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py6
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py10
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py7
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py53
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py52
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py23
6 files changed, 76 insertions, 75 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
index 6a832e02990..63eb5e087e1 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
@@ -23,8 +23,7 @@ class LibCxxFunctionTestCase(TestBase):
var.SetPreferSyntheticValue(True)
return var
- @skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ @add_test_categories(["libc++"])
def test(self):
"""Test that std::function as defined by libc++ is correctly printed by LLDB"""
self.build()
@@ -36,9 +35,6 @@ class LibCxxFunctionTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(
- self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
-
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
index 5d23fcef04c..9b4308f5409 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
@@ -22,9 +22,10 @@ class LibcxxIteratorDataFormatterTestCase(TestBase):
TestBase.setUp(self)
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
+ ns = 'ndk' if lldbplatformutil.target_is_android() else ''
+ self.namespace = 'std::__' + ns + '1'
- @skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ @add_test_categories(["libc++"])
def test_with_run_command(self):
"""Test that libc++ iterators format properly."""
self.build()
@@ -35,9 +36,6 @@ class LibcxxIteratorDataFormatterTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(
- self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
-
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
@@ -57,8 +55,6 @@ class LibcxxIteratorDataFormatterTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs=self.getLibcPlusPlusLibs())
-
self.expect('frame variable ivI', substrs=['item = 3'])
self.expect('expr ivI', substrs=['item = 3'])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
index e2e082c795f..e1ebbd5c226 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
@@ -19,9 +19,8 @@ class LibcxxListDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
- @add_test_categories(["pyapi"])
+ @add_test_categories(["libc++"])
+ @expectedFailureAndroid(bugnumber="llvm.org/pr32592")
@skipIfDarwin # rdar://25499635
def test_with_run_command(self):
self.build()
@@ -40,8 +39,6 @@ class LibcxxListDataFormatterTestCase(TestBase):
# Run the program, it should stop at breakpoint 1.
process = target.LaunchSimple(
None, None, self.get_process_working_directory())
- lldbutil.skip_if_library_missing(
- self, target, lldbutil.PrintableRegex("libc\+\+"))
self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID)
self.assertEqual(
len(lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint1)), 1)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
index 7433a0b0da2..fc4714ea94e 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
@@ -17,8 +17,12 @@ class LibcxxMapDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ def setUp(self):
+ TestBase.setUp(self)
+ ns = 'ndk' if lldbplatformutil.target_is_android() else ''
+ self.namespace = 'std::__' + ns + '1'
+
+ @add_test_categories(["libc++"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
@@ -30,9 +34,6 @@ class LibcxxMapDataFormatterTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(
- self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
-
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
@@ -52,16 +53,16 @@ class LibcxxMapDataFormatterTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs=self.getLibcPlusPlusLibs())
-
+ ns = self.namespace
self.expect('frame variable ii',
- substrs=['size=0',
+ substrs=['%s::map' % ns,
+ 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs=['size=2',
+ substrs=['%s::map' % ns, 'size=2',
'[0] = ',
'first = 0',
'second = 0',
@@ -72,7 +73,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs=['size=4',
+ substrs=['%s::map' % ns, 'size=4',
'[2] = ',
'first = 2',
'second = 0',
@@ -83,7 +84,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ii",
- substrs=['size=8',
+ substrs=['%s::map' % ns, 'size=8',
'[5] = ',
'first = 5',
'second = 0',
@@ -92,7 +93,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
'second = 1'])
self.expect("p ii",
- substrs=['size=8',
+ substrs=['%s::map' % ns, 'size=8',
'[5] = ',
'first = 5',
'second = 0',
@@ -124,17 +125,17 @@ class LibcxxMapDataFormatterTestCase(TestBase):
self.runCmd("continue")
self.expect('frame variable ii',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
self.expect('frame variable si',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
self.runCmd("continue")
self.expect('frame variable si',
- substrs=['size=1',
+ substrs=['%s::map' % ns, 'size=1',
'[0] = ',
'first = \"zero\"',
'second = 0'])
@@ -142,7 +143,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable si",
- substrs=['size=4',
+ substrs=['%s::map' % ns, 'size=4',
'[0] = ',
'first = \"zero\"',
'second = 0',
@@ -157,7 +158,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
'second = 3'])
self.expect("p si",
- substrs=['size=4',
+ substrs=['%s::map' % ns, 'size=4',
'[0] = ',
'first = \"zero\"',
'second = 0',
@@ -192,19 +193,19 @@ class LibcxxMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable si',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable is',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable is",
- substrs=['size=4',
+ substrs=['%s::map' % ns, 'size=4',
'[0] = ',
'second = \"goofy\"',
'first = 85',
@@ -219,7 +220,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
'first = 3'])
self.expect("p is",
- substrs=['size=4',
+ substrs=['%s::map' % ns, 'size=4',
'[0] = ',
'second = \"goofy\"',
'first = 85',
@@ -254,19 +255,19 @@ class LibcxxMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable is',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ss',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ss",
- substrs=['size=3',
+ substrs=['%s::map' % ns, 'size=3',
'[0] = ',
'second = \"hello\"',
'first = \"ciao\"',
@@ -278,7 +279,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
'first = \"gatto\"'])
self.expect("p ss",
- substrs=['size=3',
+ substrs=['%s::map' % ns, 'size=3',
'[0] = ',
'second = \"hello\"',
'first = \"ciao\"',
@@ -309,5 +310,5 @@ class LibcxxMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ss',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
index 66091e6e113..b28a7e6bc31 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
@@ -18,8 +18,12 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfWindows # libc++ not ported to Windows yet
- @skipIf(compiler="gcc")
+ def setUp(self):
+ TestBase.setUp(self)
+ ns = 'ndk' if lldbplatformutil.target_is_android() else ''
+ self.namespace = 'std::__' + ns + '1'
+
+ @add_test_categories(["libc++"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
@@ -31,9 +35,6 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(
- self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
-
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
@@ -53,16 +54,15 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs=self.getLibcPlusPlusLibs())
-
+ multimap = self.namespace + "::multimap"
self.expect('frame variable ii',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs=['size=2',
+ substrs=[multimap, 'size=2',
'[0] = ',
'first = 0',
'second = 0',
@@ -73,7 +73,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs=['size=4',
+ substrs=[multimap, 'size=4',
'[2] = ',
'first = 2',
'second = 0',
@@ -84,7 +84,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ii",
- substrs=['size=8',
+ substrs=[multimap, 'size=8',
'[5] = ',
'first = 5',
'second = 0',
@@ -93,7 +93,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
'second = 1'])
self.expect("p ii",
- substrs=['size=8',
+ substrs=[multimap, 'size=8',
'[5] = ',
'first = 5',
'second = 0',
@@ -125,17 +125,17 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
self.expect('frame variable si',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable si',
- substrs=['size=1',
+ substrs=[multimap, 'size=1',
'[0] = ',
'first = \"zero\"',
'second = 0'])
@@ -143,7 +143,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable si",
- substrs=['size=4',
+ substrs=[multimap, 'size=4',
'[0] = ',
'first = \"zero\"',
'second = 0',
@@ -158,7 +158,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
'second = 3'])
self.expect("p si",
- substrs=['size=4',
+ substrs=[multimap, 'size=4',
'[0] = ',
'first = \"zero\"',
'second = 0',
@@ -193,19 +193,19 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable si',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable is',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable is",
- substrs=['size=4',
+ substrs=[multimap, 'size=4',
'[0] = ',
'second = \"goofy\"',
'first = 85',
@@ -220,7 +220,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
'first = 3'])
self.expect("p is",
- substrs=['size=4',
+ substrs=[multimap, 'size=4',
'[0] = ',
'second = \"goofy\"',
'first = 85',
@@ -255,19 +255,19 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable is',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ss',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ss",
- substrs=['size=3',
+ substrs=[multimap, 'size=3',
'[0] = ',
'second = \"hello\"',
'first = \"ciao\"',
@@ -279,7 +279,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
'first = \"gatto\"'])
self.expect("p ss",
- substrs=['size=3',
+ substrs=[multimap, 'size=3',
'[0] = ',
'second = \"hello\"',
'first = \"ciao\"',
@@ -310,5 +310,5 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ss',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
index d40bce83e0a..2f448e8fd11 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
@@ -17,8 +17,17 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ def setUp(self):
+ TestBase.setUp(self)
+ ns = 'ndk' if lldbplatformutil.target_is_android() else ''
+ self.namespace = 'std::__' + ns + '1'
+
+ def getVariableType(self, name):
+ var = self.frame().FindVariable(name)
+ self.assertTrue(var.IsValid())
+ return var.GetType().GetCanonicalType().GetName()
+
+ @add_test_categories(["libc++"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
@@ -30,9 +39,6 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(
- self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
-
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
@@ -52,7 +58,9 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs=self.getLibcPlusPlusLibs())
+ ii_type = self.getVariableType("ii")
+ self.assertTrue(ii_type.startswith(self.namespace + "::multiset"),
+ "Type: " + ii_type)
self.expect("frame variable ii", substrs=["size=0", "{}"])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
@@ -86,6 +94,9 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
self.expect("frame variable ii", substrs=["size=0", "{}"])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ii", substrs=["size=0", "{}"])
+ ss_type = self.getVariableType("ss")
+ self.assertTrue(ss_type.startswith(self.namespace + "::multiset"),
+ "Type: " + ss_type)
self.expect("frame variable ss", substrs=["size=0", "{}"])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect(
OpenPOWER on IntegriCloud