Replace sys.platform skips in tests with @skip decorators which check against remote platform.
Adds @skipIfPlatform and @skipUnlessPlatform decorators which will skip if /
unless the target platform is in the provided platform list.
Test Plan:
ninja check-lldb shows no regressions.
When running cross platform, tests which cannot run on the target platform are
skipped.
Differential Revision: http://reviews.llvm.org/D8665
llvm-svn: 233547
diff --git a/lldb/test/lang/cpp/bool/TestCPPBool.py b/lldb/test/lang/cpp/bool/TestCPPBool.py
index a8ee86e..fc1c574 100644
--- a/lldb/test/lang/cpp/bool/TestCPPBool.py
+++ b/lldb/test/lang/cpp/bool/TestCPPBool.py
@@ -9,7 +9,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_and_run_command(self):
"""Test that bool types work in the expression parser"""
diff --git a/lldb/test/lang/cpp/breakpoints/TestCPPBreakpoints.py b/lldb/test/lang/cpp/breakpoints/TestCPPBreakpoints.py
index 675e5b4..a856523 100644
--- a/lldb/test/lang/cpp/breakpoints/TestCPPBreakpoints.py
+++ b/lldb/test/lang/cpp/breakpoints/TestCPPBreakpoints.py
@@ -11,7 +11,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym(self):
"""Test a sequence of breakpoint command add, list, and delete."""
diff --git a/lldb/test/lang/cpp/call-function/TestCallCPPFunction.py b/lldb/test/lang/cpp/call-function/TestCallCPPFunction.py
index a026f14..cb0725a 100644
--- a/lldb/test/lang/cpp/call-function/TestCallCPPFunction.py
+++ b/lldb/test/lang/cpp/call-function/TestCallCPPFunction.py
@@ -10,7 +10,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_and_run_command(self):
"""Test calling a function by basename"""
diff --git a/lldb/test/lang/cpp/char1632_t/TestChar1632T.py b/lldb/test/lang/cpp/char1632_t/TestChar1632T.py
index b6995fd..7515695 100644
--- a/lldb/test/lang/cpp/char1632_t/TestChar1632T.py
+++ b/lldb/test/lang/cpp/char1632_t/TestChar1632T.py
@@ -13,7 +13,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym(self):
"""Test that the C++11 support for char16_t and char32_t works correctly."""
diff --git a/lldb/test/lang/cpp/class_static/TestStaticVariables.py b/lldb/test/lang/cpp/class_static/TestStaticVariables.py
index fad69a2..c2d2024 100644
--- a/lldb/test/lang/cpp/class_static/TestStaticVariables.py
+++ b/lldb/test/lang/cpp/class_static/TestStaticVariables.py
@@ -13,7 +13,7 @@
mydir = TestBase.compute_mydir(__file__)
failing_compilers = ['clang', 'gcc']
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_and_run_command(self):
"""Test that file and class static variables display correctly."""
@@ -26,7 +26,7 @@
self.buildDwarf()
self.static_variable_commands()
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@expectedFailureClang(9980907)
@expectedFailureGcc(9980907)
@python_api_test
diff --git a/lldb/test/lang/cpp/class_types/TestClassTypes.py b/lldb/test/lang/cpp/class_types/TestClassTypes.py
index f988845..41313df 100644
--- a/lldb/test/lang/cpp/class_types/TestClassTypes.py
+++ b/lldb/test/lang/cpp/class_types/TestClassTypes.py
@@ -12,14 +12,14 @@
mydir = TestBase.compute_mydir(__file__)
failing_compilers = ['clang', 'gcc']
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_and_run_command(self):
"""Test 'frame variable this' when stopped on a class constructor."""
self.buildDsym()
self.class_types()
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@python_api_test
@dsym_test
def test_with_dsym_and_python_api(self):
@@ -43,7 +43,7 @@
self.buildDwarf()
self.breakpoint_creation_by_filespec_python()
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
# rdar://problem/8557478
# test/class_types test failures: runCmd: expr this->m_c_int
@dsym_test
@@ -60,7 +60,7 @@
self.buildDwarf()
self.class_types_expr_parser()
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
# rdar://problem/8557478
# test/class_types test failures: runCmd: expr this->m_c_int
@dsym_test
diff --git a/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py b/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py
index 38452f1..2e401147 100644
--- a/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py
+++ b/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py
@@ -13,7 +13,7 @@
mydir = TestBase.compute_mydir(__file__)
failing_compilers = ['clang', 'gcc']
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_and_run_command(self):
"""Disassemble each call frame when stopped on C's constructor."""
@@ -26,7 +26,7 @@
self.buildDwarf()
self.disassemble_call_stack()
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@python_api_test
@dsym_test
def test_with_dsym_and_python_api(self):
diff --git a/lldb/test/lang/cpp/diamond/TestDiamond.py b/lldb/test/lang/cpp/diamond/TestDiamond.py
index 247da48..fd1ca36 100644
--- a/lldb/test/lang/cpp/diamond/TestDiamond.py
+++ b/lldb/test/lang/cpp/diamond/TestDiamond.py
@@ -9,7 +9,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_and_run_command(self):
"""Test that virtual base classes work in when SBValue objects are used to explore the variable value"""
diff --git a/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py b/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py
index e3fbcfc..23a9fc5 100644
--- a/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py
+++ b/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py
@@ -13,7 +13,7 @@
mydir = TestBase.compute_mydir(__file__)
@unittest2.expectedFailure("rdar://problem/10808472 SBValue::Cast test case is failing (virtual inheritance)")
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@python_api_test
@dsym_test
def test_value_cast_with_dsym_and_virtual_inheritance(self):
@@ -31,7 +31,7 @@
self.setTearDownCleanup(dictionary=self.d_virtual)
self.do_sbvalue_cast(self.exe_name)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@python_api_test
@dsym_test
def test_value_cast_with_dsym_and_regular_inheritance(self):
diff --git a/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py b/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py
index 576d964..1de0a7b 100644
--- a/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py
+++ b/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py
@@ -12,7 +12,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@python_api_test
@dsym_test
def test_get_dynamic_vals_with_dsym(self):
diff --git a/lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py b/lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
index 77dbaea..014a441 100644
--- a/lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
+++ b/lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
@@ -10,56 +10,56 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_int8_t(self):
"""Test C++11 enumeration class types as int8_t types."""
self.buildDsym(dictionary={'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int8_t"'})
self.image_lookup_for_enum_type()
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_int16_t(self):
"""Test C++11 enumeration class types as int16_t types."""
self.buildDsym(dictionary={'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int16_t"'})
self.image_lookup_for_enum_type()
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_int32_t(self):
"""Test C++11 enumeration class types as int32_t types."""
self.buildDsym(dictionary={'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int32_t"'})
self.image_lookup_for_enum_type()
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_int64_t(self):
"""Test C++11 enumeration class types as int64_t types."""
self.buildDsym(dictionary={'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int64_t"'})
self.image_lookup_for_enum_type()
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_uint8_t(self):
"""Test C++11 enumeration class types as uint8_t types."""
self.buildDsym(dictionary={'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint8_t"'})
self.image_lookup_for_enum_type()
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_uint16_t(self):
"""Test C++11 enumeration class types as uint16_t types."""
self.buildDsym(dictionary={'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint16_t"'})
self.image_lookup_for_enum_type()
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_uint32_t(self):
"""Test C++11 enumeration class types as uint32_t types."""
self.buildDsym(dictionary={'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint32_t"'})
self.image_lookup_for_enum_type()
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_uint64_t(self):
"""Test C++11 enumeration class types as uint64_t types."""
diff --git a/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py b/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
index bb81d6d..3a896d4 100644
--- a/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
+++ b/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
@@ -12,7 +12,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym(self):
"""Test lldb exception breakpoint command for CPP."""
diff --git a/lldb/test/lang/cpp/namespace/TestNamespace.py b/lldb/test/lang/cpp/namespace/TestNamespace.py
index 4e24926..d50490f 100644
--- a/lldb/test/lang/cpp/namespace/TestNamespace.py
+++ b/lldb/test/lang/cpp/namespace/TestNamespace.py
@@ -13,7 +13,7 @@
mydir = TestBase.compute_mydir(__file__)
# rdar://problem/8668674
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_and_run_command(self):
"""Test that anonymous and named namespace variables display correctly."""
diff --git a/lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py b/lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
index 987b15f..0ae186f 100644
--- a/lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
+++ b/lldb/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
@@ -10,7 +10,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_and_run_command(self):
"""Test that functions with the same name are resolved correctly"""
diff --git a/lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py b/lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py
index 35217c1..9e48b3d 100644
--- a/lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py
+++ b/lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py
@@ -27,7 +27,7 @@
mydir = TestBase.compute_mydir(__file__)
@unittest2.expectedFailure("rdar://18684408")
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_expr1_with_dsym(self):
"""Test that the expression parser returns proper Unicode strings."""
@@ -42,7 +42,7 @@
self.rdar12991846(expr=1)
@unittest2.expectedFailure("rdar://18684408")
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_expr2_with_dsym(self):
"""Test that the expression parser returns proper Unicode strings."""
@@ -57,7 +57,7 @@
self.rdar12991846(expr=2)
@unittest2.expectedFailure("rdar://18684408")
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_expr3_with_dsym(self):
"""Test that the expression parser returns proper Unicode strings."""
diff --git a/lldb/test/lang/cpp/rvalue-references/TestRvalueReferences.py b/lldb/test/lang/cpp/rvalue-references/TestRvalueReferences.py
index 9b00f90..3a855bd 100644
--- a/lldb/test/lang/cpp/rvalue-references/TestRvalueReferences.py
+++ b/lldb/test/lang/cpp/rvalue-references/TestRvalueReferences.py
@@ -10,7 +10,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@expectedFailureClang("rdar://problem/11479676")
@dsym_test
def test_with_dsym_and_run_command(self):
diff --git a/lldb/test/lang/cpp/signed_types/TestSignedTypes.py b/lldb/test/lang/cpp/signed_types/TestSignedTypes.py
index f4d3333..36c2b6d 100644
--- a/lldb/test/lang/cpp/signed_types/TestSignedTypes.py
+++ b/lldb/test/lang/cpp/signed_types/TestSignedTypes.py
@@ -13,7 +13,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym(self):
"""Test that variables with signed types display correctly."""
diff --git a/lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py b/lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py
index d49b86a..83516b7 100644
--- a/lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py
+++ b/lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py
@@ -9,7 +9,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@unittest2.expectedFailure # llvm.org/pr15401
@dsym_test
def test_with_dsym_and_run_command(self):
diff --git a/lldb/test/lang/cpp/static_methods/TestCPPStaticMethods.py b/lldb/test/lang/cpp/static_methods/TestCPPStaticMethods.py
index 25dec6f..8fa358c 100644
--- a/lldb/test/lang/cpp/static_methods/TestCPPStaticMethods.py
+++ b/lldb/test/lang/cpp/static_methods/TestCPPStaticMethods.py
@@ -10,7 +10,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym_and_run_command(self):
"""Test that static methods are properly distinguished from regular methods"""
diff --git a/lldb/test/lang/cpp/stl/TestSTL.py b/lldb/test/lang/cpp/stl/TestSTL.py
index 309d169..0b7d8d3 100644
--- a/lldb/test/lang/cpp/stl/TestSTL.py
+++ b/lldb/test/lang/cpp/stl/TestSTL.py
@@ -14,7 +14,7 @@
# rdar://problem/10400981
@unittest2.expectedFailure
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym(self):
"""Test some expressions involving STL data types."""
diff --git a/lldb/test/lang/cpp/this/TestCPPThis.py b/lldb/test/lang/cpp/this/TestCPPThis.py
index 0d059c5..1e5731e 100644
--- a/lldb/test/lang/cpp/this/TestCPPThis.py
+++ b/lldb/test/lang/cpp/this/TestCPPThis.py
@@ -9,7 +9,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
#rdar://problem/9962849
#@expectedFailureClang
@dsym_test
diff --git a/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py b/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py
index e07c02e..799e2fd 100644
--- a/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py
+++ b/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py
@@ -11,7 +11,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym(self):
"""Test for unique types of std::vector<long> and std::vector<short>."""
diff --git a/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py b/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
index 66b4a54..5959d86 100644
--- a/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
+++ b/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
@@ -13,7 +13,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym(self):
"""Test that variables with unsigned types display correctly."""
diff --git a/lldb/test/lang/cpp/virtual/TestVirtual.py b/lldb/test/lang/cpp/virtual/TestVirtual.py
index e2c09cd..797afaf 100644
--- a/lldb/test/lang/cpp/virtual/TestVirtual.py
+++ b/lldb/test/lang/cpp/virtual/TestVirtual.py
@@ -22,8 +22,8 @@
# Assert message.
PRINTF_OUTPUT_GROKKED = "The printf output from compiled code is parsed correctly"
- @unittest2.skipIf(sys.platform.startswith("win32"), "Process::GetSTDOUT unsupported on Windows. This test should be re-written to use stdout re-direction")
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipIfWindows # Process::GetSTDOUT unsupported on Windows. This test should be re-written to use stdout re-direction
+ @skipUnlessDarwin
def test_virtual_madness_dsym(self):
"""Test that expression works correctly with virtual inheritance as well as virtual function."""
self.buildDsym()
diff --git a/lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py b/lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py
index 10804c1..80e1130 100644
--- a/lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py
+++ b/lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py
@@ -13,7 +13,7 @@
mydir = TestBase.compute_mydir(__file__)
- @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ @skipUnlessDarwin
@dsym_test
def test_with_dsym(self):
"""Test that C++ supports wchar_t correctly."""