Skip to content

Commit bb018f4

Browse files
Merge pull request swiftlang#1997 from Teemperor/MakeSwiftTestDecoratorNotAlwaysSkip
[lldb][swift] Make swiftTest decorator not always skip and skipIf regressed tests temporarily
2 parents e0ff757 + 603a944 commit bb018f4

File tree

12 files changed

+25
-8
lines changed

12 files changed

+25
-8
lines changed

lldb/packages/Python/lldbsuite/test/decorators.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,8 @@ def skipUnlessTargetAndroid(func):
626626
def swiftTest(func):
627627
"""Decorate the item as a Swift test (Darwin/Linux only, no i386)."""
628628
def is_not_swift_compatible(self):
629-
swift_enabled_error = _get_bool_config_skip_if_decorator("swift")(func)
630-
if swift_enabled_error:
631-
return swift_enabled_error
629+
if not _get_bool_config("swift"):
630+
return "Swift plugin not enabled"
632631
if self.getDebugInfo() == "gmodules":
633632
return "skipping (gmodules only makes sense for clang tests)"
634633

@@ -886,11 +885,14 @@ def skipIfAsan(func):
886885
"""Skip this test if the environment is set up to run LLDB *itself* under ASAN."""
887886
return skipTestIfFn(is_running_under_asan)(func)
888887

889-
def _get_bool_config_skip_if_decorator(key):
888+
def _get_bool_config(key):
890889
config = lldb.SBDebugger.GetBuildConfiguration()
891890
value_node = config.GetValueForKey(key)
892891
fail_value = True # More likely to notice if something goes wrong
893-
have = value_node.GetValueForKey("value").GetBooleanValue(fail_value)
892+
return value_node.GetValueForKey("value").GetBooleanValue(fail_value)
893+
894+
def _get_bool_config_skip_if_decorator(key):
895+
have = _get_bool_config(key)
894896
return unittest2.skipIf(not have, "requires " + key)
895897

896898
def skipIfCursesSupportMissing(func):

lldb/test/API/lang/swift/clangimporter/headermap_conflict/TestSwiftHeadermapConflict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class TestSwiftHeadermapConflict(TestBase):
2525
def setUp(self):
2626
TestBase.setUp(self)
2727

28+
@skipIf #FIXME: This regressed silently due to 2c911bceb06ed376801251bdfd992905a66f276c
2829
@skipIf(bugnumber="rdar://60396797",
2930
setting=('symbols.use-swift-clangimporter', 'false'))
3031
@skipUnlessDarwin

lldb/test/API/lang/swift/clangimporter/remoteast_import/TestSwiftRemoteASTImport.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class TestSwiftRemoteASTImport(TestBase):
2424
def setUp(self):
2525
TestBase.setUp(self)
2626

27+
@expectedFailureAll #FIXME: This regressed silently due to 2c911bceb06ed376801251bdfd992905a66f276c
2728
# Don't run ClangImporter tests if Clangimporter is disabled.
2829
@skipIf(setting=('symbols.use-swift-clangimporter', 'false'))
2930
@skipUnlessDarwin

lldb/test/API/lang/swift/dwarfimporter/C/TestSwiftDWARFImporterC.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def test_dwarf_importer(self):
6767
target.Clear()
6868
lldb.SBDebugger.MemoryPressureDetected()
6969

70+
@expectedFailureAll #FIXME: This regressed silently due to 2c911bceb06ed376801251bdfd992905a66f276c
7071
@skipIf(archs=['ppc64le'], bugnumber='SR-10214')
7172
@swiftTest
7273
# This test needs a working Remote Mirrors implementation.

lldb/test/API/lang/swift/expression/static/TestSwiftExpressionsInClassFunctions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def check_expression(self, expression, expected_result, use_summary=True):
3939
self.assertTrue(answer == expected_result, report_str)
4040

4141

42+
@expectedFailureAll #FIXME: This regressed silently due to 2c911bceb06ed376801251bdfd992905a66f276c
4243
@swiftTest
4344
def test_expressions_in_class_functions(self):
4445
"""Test expressions in class func contexts"""
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import lldbsuite.test.lldbinline as lldbinline
22
from lldbsuite.test.decorators import *
33

4-
lldbinline.MakeInlineTest(__file__, globals(), decorators=[swiftTest])
4+
lldbinline.MakeInlineTest(__file__, globals(), decorators=[swiftTest,
5+
expectedFailureAll #FIXME: This regressed silently due to 2c911bceb06ed376801251bdfd992905a66f276c
6+
])
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import lldbsuite.test.lldbinline as lldbinline
22
from lldbsuite.test.decorators import *
33

4-
lldbinline.MakeInlineTest(__file__, globals(), decorators=[swiftTest])
4+
lldbinline.MakeInlineTest(__file__, globals(), decorators=[swiftTest,
5+
expectedFailureAll #FIXME: This regressed silently due to 2c911bceb06ed376801251bdfd992905a66f276c
6+
])

lldb/test/API/lang/swift/optionset/TestSwiftOptionSetType.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
lldbinline.MakeInlineTest(__file__, globals(),
1616
decorators=[swiftTest,skipUnlessDarwin,
17+
expectedFailureAll, #FIXME: This regressed silently due to 2c911bceb06ed376801251bdfd992905a66f276c
1718
expectedFailureAll(bugnumber="rdar://60396797",
1819
setting=('symbols.use-swift-clangimporter', 'false'))
1920
])

lldb/test/API/lang/swift/protocol_extension_computed_property/TestProtocolExtensionComputerProperty.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
lldbinline.MakeInlineTest(
55
__file__, globals(),
66
decorators=[
7+
expectedFailureAll, #FIXME: This regressed silently due to 2c911bceb06ed376801251bdfd992905a66f276c
78
swiftTest,skipUnlessDarwin,
89
skipIf(bugnumber="rdar://60396797", # should work but crashes.
910
setting=('symbols.use-swift-clangimporter', 'false'))

lldb/test/API/lang/swift/unknown_self/TestSwiftUnknownSelf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def check_class(self, var_self, broken):
3333
self.expect("fr v self", substrs=["hello", "world"])
3434

3535

36+
@skipIf #FIXME: This regressed silently due to 2c911bceb06ed376801251bdfd992905a66f276c
3637
@skipIf(bugnumber="SR-10216", archs=['ppc64le'])
3738
@swiftTest
3839
def test_unknown_self_objc_ref(self):

lldb/test/API/lang/swift/variables/error_type/TestSwiftErrorType.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@
1212
import lldbsuite.test.lldbinline as lldbinline
1313
from lldbsuite.test.decorators import *
1414

15-
lldbinline.MakeInlineTest(__file__, globals(), decorators=[swiftTest])
15+
lldbinline.MakeInlineTest(__file__, globals(), decorators=[
16+
#FIXME: This regressed silently due to 2c911bceb06ed376801251bdfd992905a66f276c
17+
expectedFailureAll,
18+
swiftTest])

lldb/test/API/lang/swift/variables/protocol/TestSwiftProtocolTypes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class TestSwiftProtocolTypes(TestBase):
2323

2424
mydir = TestBase.compute_mydir(__file__)
2525

26+
@expectedFailureAll #FIXME: This regressed silently due to 2c911bceb06ed376801251bdfd992905a66f276c
2627
@swiftTest
2728
def test_swift_protocol_types(self):
2829
"""Test support for protocol types"""

0 commit comments

Comments
 (0)