Rollback [test-suite] Add a decorator for the lack of libstdcxx on the system.
authorDavide Italiano <davide@freebsd.org>
Mon, 9 Jul 2018 21:56:28 +0000 (21:56 +0000)
committerDavide Italiano <davide@freebsd.org>
Mon, 9 Jul 2018 21:56:28 +0000 (21:56 +0000)
Pavel suggested an alternative approach that I'll try to implement.

llvm-svn: 336608

lldb/packages/Python/lldbsuite/test/decorators.py
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py

index 1e6cd14..1fdfd2c 100644 (file)
@@ -687,18 +687,6 @@ def skipUnlessSupportedTypeAttribute(attr):
         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."""
 
index 9acfcd6..47b0a24 100644 (file)
@@ -23,7 +23,8 @@ class StdIteratorDataFormatterTestCase(TestBase):
         # Find the line number to break at.
         self.line = line_number('main.cpp', '// Set break point at this line.')
 
-    @skipUnlessLibstdcxxAvailable
+    @skipIfWindows  # libstdcpp not ported to Windows
+    @skipIfwatchOS  # libstdcpp not ported to watchos
     def test_with_run_command(self):
         """Test that libstdcpp iterators format properly."""
         self.build()
index 10aed32..ecbea5b 100644 (file)
@@ -27,7 +27,8 @@ class StdListDataFormatterTestCase(TestBase):
         self.final_line = line_number(
             'main.cpp', '// Set final break point at this line.')
 
-    @skipUnlessLibstdcxxAvailable
+    @skipIfWindows  # libstdcpp not ported to Windows
+    @skipIfwatchOS  # libstdcpp not ported to watchos
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
index b6d2724..0abfbcb 100644 (file)
@@ -23,7 +23,9 @@ class StdMapDataFormatterTestCase(TestBase):
         # Find the line number to break at.
         self.line = line_number('main.cpp', '// Set break point at this line.')
 
-    @skipUnlessLibstdcxxAvailable
+    @skipIfWindows  # libstdcpp not ported to Windows
+    @skipIfFreeBSD
+    @skipIfwatchOS  # libstdcpp not ported to watchos
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
index 2161984..9d2c105 100644 (file)
@@ -15,8 +15,10 @@ 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
-    @skipUnlessLibstdcxxAvailable
+    @skipIfwatchOS  # libstdcpp not ported to watchos
     def test_with_run_command(self):
         self.build()
         self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
index 957389a..8f6d94a 100644 (file)
@@ -24,7 +24,8 @@ class StdStringDataFormatterTestCase(TestBase):
         # Find the line number to break at.
         self.line = line_number('main.cpp', '// Set break point at this line.')
 
-    @skipUnlessLibstdcxxAvailable
+    @skipIfWindows  # libstdcpp not ported to Windows
+    @skipIfwatchOS  # libstdcpp not ported to watchos
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
index 4de854e..81a36ee 100644 (file)
@@ -15,8 +15,10 @@ 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
-    @skipUnlessLibstdcxxAvailable
+    @skipIfwatchOS  # libstdcpp not ported to watchos
     def test_with_run_command(self):
         self.build()
         self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
index 6a22b3b..fec2e4c 100644 (file)
@@ -15,8 +15,10 @@ 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
-    @skipUnlessLibstdcxxAvailable
+    @skipIfwatchOS  # libstdcpp not ported to watchos
     def test_with_run_command(self):
         self.build()
         self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
index 20815df..7b497c6 100644 (file)
@@ -23,8 +23,12 @@ 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
-    @skipUnlessLibstdcxxAvailable
+    @skipIfwatchOS  # libstdcpp not ported to watchos
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
index 3cc0dc6..00d2c03 100644 (file)
@@ -23,7 +23,9 @@ class StdVectorDataFormatterTestCase(TestBase):
         # Find the line number to break at.
         self.line = line_number('main.cpp', '// Set break point at this line.')
 
-    @skipUnlessLibstdcxxAvailable
+    @skipIfFreeBSD
+    @skipIfWindows  # libstdcpp not ported to Windows
+    @skipIfwatchOS  # libstdcpp not ported to watchos
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()