Skip to content

Commit 28e54e8

Browse files
committed
Revise the findXcodeToolchain test case to work with more macOS systems
1 parent a67faeb commit 28e54e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Tests/SwiftlyTests/PlatformTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,15 @@ import Testing
9191
@Test(.mockedSwiftlyVersion(), .testHome()) func findXcodeToolchainLocation() async throws {
9292
// GIVEN: the xcode toolchain
9393
// AND there is xcode installed
94-
guard let xcodeLocation = try? await Swiftly.currentPlatform.runProgramOutput("xcode-select", "-p"), xcodeLocation != "" else {
94+
guard let swiftLocation = try? await Swiftly.currentPlatform.runProgramOutput("xcrun", "-f", "swift"), swiftLocation != "" else {
9595
return
9696
}
9797

9898
// WHEN: the location of the xcode toolchain can be found
9999
let toolchainLocation = try await Swiftly.currentPlatform.findToolchainLocation(SwiftlyTests.ctx, .xcodeVersion)
100100

101-
#expect(toolchainLocation.string.hasPrefix(xcodeLocation.replacingOccurrences(of: "\n", with: "")))
101+
// THEN: the xcode toolchain matches the currently selected xcode toolchain
102+
#expect(toolchainLocation.string == swiftLocation.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "/usr/bin/swift", with: ""))
102103
}
103104
#endif
104105

0 commit comments

Comments
 (0)