Skip to content

Commit 473bf33

Browse files
committed
Fix once more
1 parent 1597392 commit 473bf33

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Sources/SPMTestSupport/SwiftPMProduct.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ extension SwiftPM {
4444
}
4545
}
4646

47+
public var xctestBinaryPath: AbsolutePath {
48+
Self.xctestBinaryPath(for: executableName)
49+
}
50+
4751
public static func xctestBinaryPath(for executableName: RelativePath) -> AbsolutePath {
4852
#if canImport(Darwin)
4953
for bundle in Bundle.allBundles where bundle.bundlePath.hasSuffix(".xctest") {
@@ -109,15 +113,15 @@ extension SwiftPM {
109113
#endif
110114
// FIXME: We use this private environment variable hack to be able to
111115
// create special conditions in swift-build for swiftpm tests.
112-
environment["SWIFTPM_TESTS_MODULECACHE"] = Self.xctestBinaryPath(for: executableName).parentDirectory.pathString
116+
environment["SWIFTPM_TESTS_MODULECACHE"] = xctestBinaryPath.parentDirectory.pathString
113117
#if !os(Windows)
114118
environment["SDKROOT"] = nil
115119
#endif
116120

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

120-
var completeArgs = [Self.xctestBinaryPath(for: executableName).pathString]
124+
var completeArgs = [xctestBinaryPath.pathString]
121125
if let packagePath = packagePath {
122126
completeArgs += ["--package-path", packagePath.pathString]
123127
}

Tests/CommandsTests/RunToolTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ final class RunToolTests: CommandsTestCase {
122122

123123
let sync = DispatchGroup()
124124
let outputHandler = OutputHandler(sync: sync)
125-
let xctestBinaryPath = SwiftPM.xctestBinaryPath(for: SwiftPM.Run.executableName).pathString
126125
let process = Process(
127-
arguments: [xctestBinaryPath, "--package-path", fixturePath.pathString],
126+
arguments: [SwiftPM.Run.xctestBinaryPath.pathString, "--package-path", fixturePath.pathString],
128127
outputRedirection: .stream(stdout: outputHandler.handle(bytes:), stderr: outputHandler.handle(bytes:))
129128
)
130129

0 commit comments

Comments
 (0)