Skip to content

Commit 45cb8bf

Browse files
authored
Merge pull request #2010 from Teemperor/MakeSwiftTestDecoratorNotAlwaysSkip-next
[lldb][swift] Make swiftTest decorator not always skip
2 parents 0008e3e + f58652d commit 45cb8bf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -623,9 +623,8 @@ def skipUnlessTargetAndroid(func):
623623
def swiftTest(func):
624624
"""Decorate the item as a Swift test (Darwin/Linux only, no i386)."""
625625
def is_not_swift_compatible(self):
626-
swift_enabled_error = _get_bool_config_skip_if_decorator("swift")(func)
627-
if swift_enabled_error:
628-
return swift_enabled_error
626+
if not _get_bool_config("swift"):
627+
return "Swift plugin not enabled"
629628
if self.getDebugInfo() == "gmodules":
630629
return "skipping (gmodules only makes sense for clang tests)"
631630

@@ -883,11 +882,14 @@ def skipIfAsan(func):
883882
"""Skip this test if the environment is set up to run LLDB *itself* under ASAN."""
884883
return skipTestIfFn(is_running_under_asan)(func)
885884

886-
def _get_bool_config_skip_if_decorator(key):
885+
def _get_bool_config(key):
887886
config = lldb.SBDebugger.GetBuildConfiguration()
888887
value_node = config.GetValueForKey(key)
889888
fail_value = True # More likely to notice if something goes wrong
890-
have = value_node.GetValueForKey("value").GetBooleanValue(fail_value)
889+
return value_node.GetValueForKey("value").GetBooleanValue(fail_value)
890+
891+
def _get_bool_config_skip_if_decorator(key):
892+
have = _get_bool_config(key)
891893
return unittest2.skipIf(not have, "requires " + key)
892894

893895
def skipIfCursesSupportMissing(func):

0 commit comments

Comments
 (0)