Skip to content

Commit fba09eb

Browse files
committed
[WIP] Weak-link to XCTest
1 parent 947392e commit fba09eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Build/LLBuildCommands.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ final class TestEntryPointCommand: CustomLLBuildCommand, TestBuildCommand {
259259
#if \#(isXCTMainAvailable)
260260
\#(generateTestObservationCode(buildParameters: buildParameters))
261261

262-
import XCTest
262+
@_weakLinked import XCTest
263263
\#(discoveryModuleNames.map { "import \($0)" }.joined(separator: "\n"))
264264
#endif
265265
@@ -298,7 +298,7 @@ final class TestEntryPointCommand: CustomLLBuildCommand, TestBuildCommand {
298298
}
299299
#endif
300300
#if \#(isXCTMainAvailable)
301-
if testingLibrary == "xctest" {
301+
if testingLibrary == "xctest", #_hasSymbol(XCTMain) {
302302
\#(testObservabilitySetup)
303303
\#(awaitXCTMainKeyword) XCTMain(__allDiscoveredTests()) as Never
304304
}

0 commit comments

Comments
 (0)