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
14 changes: 8 additions & 6 deletions Sources/SPMTestSupport/SwiftPMProduct.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ extension SwiftPM {
env: [String: String]? = nil
) throws -> ProcessResult {
var environment = ProcessInfo.processInfo.environment
for (key, value) in env ?? [:] {
environment[key] = value
}
#if !os(Windows)
environment["SDKROOT"] = nil
#endif

#if Xcode
// Unset these variables which causes issues when running tests via Xcode.
environment["XCTestConfigurationFilePath"] = nil
Expand All @@ -114,13 +115,14 @@ extension SwiftPM {
// FIXME: We use this private environment variable hack to be able to
// create special conditions in swift-build for swiftpm tests.
environment["SWIFTPM_TESTS_MODULECACHE"] = xctestBinaryPath.parentDirectory.pathString
#if !os(Windows)
environment["SDKROOT"] = nil
#endif

// Unset the internal env variable that allows skipping certain tests.
environment["_SWIFTPM_SKIP_TESTS_LIST"] = nil

for (key, value) in env ?? [:] {
environment[key] = value
}

var completeArgs = [xctestBinaryPath.pathString]
if let packagePath = packagePath {
completeArgs += ["--package-path", packagePath.pathString]
Expand Down