Skip to content

Commit d0ecef5

Browse files
committed
BuildTests: adjust the path rendering for Windows
Use `AbsolutePath` to convert path to a portable spelling. This repairs some test failures on Windows.
1 parent ac8806f commit d0ecef5

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

Tests/BuildTests/BuildPlanTests.swift

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3628,7 +3628,8 @@ final class BuildPlanTests: XCTestCase {
36283628
let exe = try result.target(for: "exe").swiftTarget().compileArguments()
36293629
XCTAssertMatch(exe, [
36303630
"-module-cache-path", "\(buildPath.appending(components: "ModuleCache"))",
3631-
"-resource-dir", "/fake/lib/swift",
3631+
.anySequence,
3632+
"-resource-dir", "\(AbsolutePath("/fake/lib/swift"))",
36323633
.anySequence,
36333634
"-swift-flag-from-json",
36343635
.anySequence,
@@ -3640,7 +3641,13 @@ final class BuildPlanTests: XCTestCase {
36403641
])
36413642

36423643
let exeProduct = try result.buildProduct(for: "exe").linkArguments()
3643-
XCTAssertMatch(exeProduct, [.anySequence, "-resource-dir", "/fake/lib/swift", "-Xclang-linker", "-resource-dir", "-Xclang-linker", "/fake/lib/swift/clang", .anySequence])
3644+
XCTAssertMatch(exeProduct, [
3645+
.anySequence,
3646+
"-resource-dir", "\(AbsolutePath("/fake/lib/swift"))",
3647+
"-Xclang-linker", "-resource-dir",
3648+
"-Xclang-linker", "\(AbsolutePath("/fake/lib/swift/clang"))",
3649+
.anySequence
3650+
])
36443651

36453652
let staticBuildParameters = {
36463653
var copy = extraBuildParameters
@@ -3657,10 +3664,19 @@ final class BuildPlanTests: XCTestCase {
36573664
))
36583665

36593666
let staticExe = try staticResult.target(for: "exe").swiftTarget().compileArguments()
3660-
XCTAssertMatch(staticExe, [.anySequence, "-resource-dir", "/fake/lib/swift_static", .anySequence])
3667+
XCTAssertMatch(staticExe, [
3668+
.anySequence,
3669+
"-resource-dir", "\(AbsolutePath("/fake/lib/swift_static"))",
3670+
.anySequence])
36613671

36623672
let staticExeProduct = try staticResult.buildProduct(for: "exe").linkArguments()
3663-
XCTAssertMatch(staticExeProduct, [.anySequence, "-resource-dir", "/fake/lib/swift_static", "-Xclang-linker", "-resource-dir", "-Xclang-linker", "/fake/lib/swift/clang", .anySequence])
3673+
XCTAssertMatch(staticExeProduct, [
3674+
.anySequence,
3675+
"-resource-dir", "\(AbsolutePath("/fake/lib/swift_static"))",
3676+
"-Xclang-linker", "-resource-dir",
3677+
"-Xclang-linker", "\(AbsolutePath("/fake/lib/swift/clang"))",
3678+
.anySequence
3679+
])
36643680
}
36653681

36663682
func testUserToolchainWithToolsetCompileFlags() throws {

0 commit comments

Comments
 (0)