Skip to content

Commit 2c911bc

Browse files
committed
[lldb][swift] Only run Swift API tests when Swift support is enabled
Disabling Swift support in LLDB doesn't prevent the test suite from running the Swift tests (which then end up failing instead of being marked as unsupported). This adds swift to the SBDebugger configuration and then checks that Swift is enabled when running Swift API tests.
1 parent a2df1e4 commit 2c911bc

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,9 @@ 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
629632
if self.getDebugInfo() == "gmodules":
630633
return "skipping (gmodules only makes sense for clang tests)"
631634

lldb/source/API/SBDebugger.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,12 @@ SBStructuredData SBDebugger::GetBuildConfiguration() {
702702
"A boolean value that indicates if lua support is enabled in LLDB");
703703
AddLLVMTargets(*config_up);
704704

705+
#ifdef LLDB_ENABLE_SWIFT
706+
AddBoolConfigEntry(
707+
*config_up, "swift", true,
708+
"A boolean value that indicates if Swift support is enabled in LLDB");
709+
#endif // LLDB_ENABLE_SWIFT
710+
705711
SBStructuredData data;
706712
data.m_impl_up->SetObjectSP(std::move(config_up));
707713
return LLDB_RECORD_RESULT(data);

0 commit comments

Comments
 (0)