summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2018-07-10 20:37:24 +0000
committerDavide Italiano <davide@freebsd.org>2018-07-10 20:37:24 +0000
commit87951b6693bf061108fed2f2f95374905e4e60c7 (patch)
treee0962874280e8295c061495ccf17bf7c7f9d3eba /lldb/packages/Python/lldbsuite
parent3a0e12700bc775be452cf40f9226e535683864b7 (diff)
downloadbcm5719-llvm-87951b6693bf061108fed2f2f95374905e4e60c7.tar.gz
bcm5719-llvm-87951b6693bf061108fed2f2f95374905e4e60c7.zip
[testsuite] Implement a category to skip libstdcxx tests
On systems where it's not supported. As far as I understand Linux is the only systems which now ships with libstdcxx (maybe NetBSD?, but I'm not entirely sure of the state of lldb on the platform). We could make this more fine grained looking for the header as we do for libcxx. This is a little tricky as there's no such thing as /usr/include/c++/v1, but libstdcxx encodes the version number in the path (i.e. /usr/include/c++/5.4). I guess we might match a regex, but it seems fragile to me. Differential Revision: https://reviews.llvm.org/D49110 llvm-svn: 336724
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest.py18
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py5
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py5
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py5
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py7
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/test_categories.py1
11 files changed, 28 insertions, 30 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index de3e6983d50..d28c5ef069b 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -1104,6 +1104,23 @@ def checkLibcxxSupport():
print("Libc++ tests will not be run because: " + reason)
configuration.skipCategories.append("libc++")
+def canRunLibstdcxxTests():
+ from lldbsuite.test import lldbplatformutil
+
+ platform = lldbplatformutil.getPlatform()
+ if platform == "linux":
+ return True, "libstdcxx always present"
+ return False, "Don't know how to build with libstdcxx on %s" % platform
+
+def checkLibstdcxxSupport():
+ result, reason = canRunLibstdcxxTests()
+ if result:
+ return # libstdcxx supported
+ if "libstdcxx" in configuration.categoriesList:
+ return # libstdcxx category explicitly requested, let it run.
+ print("libstdcxx tests will not be run because: " + reason)
+ configuration.skipCategories.append("libstdcxx")
+
def checkDebugInfoSupport():
import lldb
@@ -1228,6 +1245,7 @@ def run_suite():
target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
checkLibcxxSupport()
+ checkLibstdcxxSupport()
checkDebugInfoSupport()
# Don't do debugserver tests on anything except OS X.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
index 47b0a2486ed..463e2a9f190 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
@@ -23,8 +23,7 @@ class StdIteratorDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
"""Test that libstdcpp iterators format properly."""
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
index ecbea5b24f5..7f375566054 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
@@ -27,8 +27,7 @@ class StdListDataFormatterTestCase(TestBase):
self.final_line = line_number(
'main.cpp', '// Set final break point at this line.')
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
index 0abfbcbee21..267e3beedb4 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
@@ -23,9 +23,7 @@ class StdMapDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfFreeBSD
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
index 9d2c105b116..1ca4a15d85c 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
@@ -15,10 +15,7 @@ from lldbsuite.test import lldbutil
class StdSmartPtrDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfFreeBSD
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfDarwin # doesn't compile on Darwin
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
self.build()
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
index 8f6d94a2f29..042d9fbcd6a 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
@@ -24,8 +24,7 @@ class StdStringDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
index 81a36ee63dd..c2e02f54669 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
@@ -15,10 +15,7 @@ from lldbsuite.test import lldbutil
class StdTupleDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfFreeBSD
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfDarwin # doesn't compile on Darwin
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
self.build()
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
index fec2e4c1a4c..5d05418a8b4 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
@@ -15,10 +15,7 @@ from lldbsuite.test import lldbutil
class StdUniquePtrDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfFreeBSD
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfDarwin # doesn't compile on Darwin
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
self.build()
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
index 7b497c68c70..fb37838bdaf 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
@@ -23,12 +23,7 @@ class StdVBoolDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @expectedFailureAll(
- oslist=['freebsd'],
- bugnumber='llvm.org/pr20548 fails to build on lab.llvm.org buildbot')
- @skipIfWindows # libstdcpp not ported to Windows.
- @skipIfDarwin
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
index 00d2c038f61..712de3d41f7 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
@@ -23,9 +23,7 @@ class StdVectorDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfFreeBSD
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/test_categories.py b/lldb/packages/Python/lldbsuite/test/test_categories.py
index 42ae019bc8f..8a9fd742111 100644
--- a/lldb/packages/Python/lldbsuite/test/test_categories.py
+++ b/lldb/packages/Python/lldbsuite/test/test_categories.py
@@ -26,6 +26,7 @@ all_categories = {
'gmodules': 'Tests that can be run with -gmodules debug information',
'expression': 'Tests related to the expression parser',
'libc++': 'Test for libc++ data formatters',
+ 'libstdcxx': 'Test for libstdcxx data formatters',
'objc': 'Tests related to the Objective-C programming language support',
'pyapi': 'Tests related to the Python API',
'basic_process': 'Basic process execution sniff tests.',
OpenPOWER on IntegriCloud