[Lldb-commits] [lldb] r336463 - [test-suite] Add a decorator for the lack of libstdcxx on the system.
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Fri Jul 6 13:40:00 PDT 2018
Author: davide
Date: Fri Jul 6 13:40:00 2018
New Revision: 336463
URL: http://llvm.org/viewvc/llvm-project?rev=336463&view=rev
Log:
[test-suite] Add a decorator for the lack of libstdcxx on the system.
This generalizes a bunch of target-specific tests. MacOS has no
libstdcxx anymore, and neither does FreeBSD (or Windows).
<rdar://problem/41896105>
Modified:
lldb/trunk/packages/Python/lldbsuite/test/decorators.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=336463&r1=336462&r2=336463&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Fri Jul 6 13:40:00 2018
@@ -687,6 +687,18 @@ def skipUnlessSupportedTypeAttribute(att
return None
return skipTestIfFn(compiler_doesnt_support_struct_attribute)
+def skipUnlessLibstdcxxAvailable(func):
+ """Decorate the item to skip test unless libstdc++ is available on the system."""
+ def compiler_doesnt_support_libstdcxx(self):
+ compiler_path = self.getCompiler()
+ f = tempfile.NamedTemporaryFile()
+ f = tempfile.NamedTemporaryFile()
+ cmd = "echo '#include <string> | %s -x c++ -stdlib=libstdc++ -o %s -" % (compiler_path, f.name)
+ if os.popen(cmd).close() is not None:
+ return "libstdcxx not available on the sytem"
+ return None
+ return skipTestIfFn(compiler_doesnt_support_libstdcxx)(func)
+
def skipUnlessThreadSanitizer(func):
"""Decorate the item to skip test unless Clang -fsanitize=thread is supported."""
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py?rev=336463&r1=336462&r2=336463&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py Fri Jul 6 13:40:00 2018
@@ -23,8 +23,7 @@ class StdIteratorDataFormatterTestCase(T
# 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
+ @skipUnlessLibstdcxxAvailable
def test_with_run_command(self):
"""Test that libstdcpp iterators format properly."""
self.build()
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py?rev=336463&r1=336462&r2=336463&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py Fri Jul 6 13:40:00 2018
@@ -27,8 +27,7 @@ class StdListDataFormatterTestCase(TestB
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
+ @skipUnlessLibstdcxxAvailable
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py?rev=336463&r1=336462&r2=336463&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py Fri Jul 6 13:40:00 2018
@@ -23,9 +23,7 @@ class StdMapDataFormatterTestCase(TestBa
# 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
+ @skipUnlessLibstdcxxAvailable
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py?rev=336463&r1=336462&r2=336463&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py Fri Jul 6 13:40:00 2018
@@ -15,10 +15,8 @@ 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
+ @skipUnlessLibstdcxxAvailable
def test_with_run_command(self):
self.build()
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py?rev=336463&r1=336462&r2=336463&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py Fri Jul 6 13:40:00 2018
@@ -24,8 +24,7 @@ class StdStringDataFormatterTestCase(Tes
# 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
+ @skipUnlessLibstdcxxAvailable
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py?rev=336463&r1=336462&r2=336463&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py Fri Jul 6 13:40:00 2018
@@ -15,10 +15,8 @@ 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
+ @skipUnlessLibstdcxxAvailable
def test_with_run_command(self):
self.build()
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py?rev=336463&r1=336462&r2=336463&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py Fri Jul 6 13:40:00 2018
@@ -15,10 +15,8 @@ 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
+ @skipUnlessLibstdcxxAvailable
def test_with_run_command(self):
self.build()
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py?rev=336463&r1=336462&r2=336463&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py Fri Jul 6 13:40:00 2018
@@ -23,12 +23,8 @@ class StdVBoolDataFormatterTestCase(Test
# 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
+ @skipUnlessLibstdcxxAvailable
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py?rev=336463&r1=336462&r2=336463&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py Fri Jul 6 13:40:00 2018
@@ -23,9 +23,7 @@ class StdVectorDataFormatterTestCase(Tes
# 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
+ @skipUnlessLibstdcxxAvailable
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
More information about the lldb-commits
mailing list