Skip to content

Commit 36a9c9f

Browse files
committed
SKTestSupport: account for executable extensions
Windows uses executable extensions. Account for them to enable tests to pass on Windows.
1 parent 4209242 commit 36a9c9f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/SKTestSupport/SKTibsTestWorkspace.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,17 +219,19 @@ extension Location {
219219

220220
extension TibsToolchain {
221221
public convenience init(_ sktc: Toolchain) {
222+
let execExt: String = Platform.currentPlatform?.executableExtension ?? ""
223+
222224
let ninja: URL?
223225
if let ninjaPath = ProcessInfo.processInfo.environment["NINJA_BIN"] {
224226
ninja = URL(fileURLWithPath: ninjaPath, isDirectory: false)
225227
} else {
226-
ninja = findTool(name: "ninja")
228+
ninja = findTool(name: "ninja\(execExt)")
227229
}
228230
self.init(
229231
swiftc: sktc.swiftc!.asURL,
230232
clang: sktc.clang!.asURL,
231233
libIndexStore: sktc.libIndexStore!.asURL,
232-
tibs: XCTestCase.productsDirectory.appendingPathComponent("tibs", isDirectory: false),
234+
tibs: XCTestCase.productsDirectory.appendingPathComponent("tibs\(execExt)", isDirectory: false),
233235
ninja: ninja)
234236
}
235237
}

0 commit comments

Comments
 (0)