Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion Sources/SKTestSupport/IndexedSingleSwiftFileTestProject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ package struct IndexedSingleSwiftFileTestProject {
if let sdk = defaultSDKPath {
compilerArguments += ["-sdk", sdk]

// The following are needed so we can import XCTest
// The following are needed so we can import XCTest and Swift Testing.
let sdkUrl = URL(fileURLWithPath: sdk)
#if os(Windows)
let platform = sdkUrl.deletingLastPathComponent().deletingLastPathComponent().deletingLastPathComponent()
Expand All @@ -131,6 +131,23 @@ package struct IndexedSingleSwiftFileTestProject {
"windows"
)
compilerArguments += ["-I", try xctestModuleDir.filePath]

// Test files that only import XCTest still depend on Swift Testing for
// interoperability support.
if let swiftTestingVersion = info.defaults.swiftTestingVersion {
let swiftTestingModuleDir =
platform
.appending(
components: "Developer",
"Library",
"Testing-\(swiftTestingVersion)",
"usr",
"lib",
"swift",
"windows"
)
compilerArguments += ["-I", try swiftTestingModuleDir.filePath]
}
#else
let usrLibDir =
sdkUrl
Expand Down