Skip to content

Commit 040f8a8

Browse files
[Testing] Try fix windows build
1 parent b989609 commit 040f8a8

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

Tests/SwiftDriverTests/Helpers/IncrementalTestHarness.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ extension IncrementalTestHarness {
915915
}
916916

917917
func doTheCompile(_ driver: inout Driver) {
918+
touch(tempDir.appending(component: "timestamp"))
918919
let jobs = try! driver.planBuild()
919920
try? driver.run(jobs: jobs)
920921
}

Tests/SwiftDriverTests/IncrementalExplicitBuildTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ struct IncrementalExplicitBuildTests: DiagVerifiable {
232232

233233
let EInterfacePath = h.explicitSwiftDependenciesPath.appending(component: "E.swiftinterface")
234234
// Just update the time-stamp of one of the module dependencies and use a value
235-
// it is defined in.
235+
// it is defined in. Touch twice to make sure it is newer than the build product.
236+
h.touch(EInterfacePath)
236237
h.touch(EInterfacePath)
237238
h.replace(contentsOf: "other", with: "import E;let bar = foo + moduleEValue")
238239

Tests/SwiftDriverTests/ToolchainTests.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,17 @@ import CRT
188188
try localFileSystem.createSymbolicLink(customSwiftFrontend, pointingAt: defaultSwiftFrontend, relative: false)
189189

190190
try withTemporaryDirectory { tempDirectory in
191+
let fs = TestLocalFileSystem(cwd: tempDirectory)
191192
let anotherSwiftFrontend = tempDirectory.appending(component: executableName("swift-frontend"))
192-
try localFileSystem.createSymbolicLink(anotherSwiftFrontend, pointingAt: defaultSwiftFrontend, relative: false)
193+
try fs.createSymbolicLink(anotherSwiftFrontend, pointingAt: defaultSwiftFrontend, relative: false)
193194

194195
// test if SWIFT_DRIVER_TOOLNAME_EXEC is respected
195196
do {
196197
var driver = try Driver.forTesting(args: ["swiftc", "-print-target-info"],
197198
env: [PATH: ProcessEnv.path!,
198199
SWIFT_FRONTEND_EXEC: customSwiftFrontend.pathString,
199-
SWIFT_SCANNER_LIB: customSwiftScan.pathString])
200+
SWIFT_SCANNER_LIB: customSwiftScan.pathString],
201+
fileSystem: fs)
200202
let jobs = try driver.planBuild()
201203
#expect(jobs.count == 1)
202204
expectEqual(jobs.first!.tool.name, customSwiftFrontend.pathString)
@@ -205,7 +207,8 @@ import CRT
205207
// test if tools directory is respected
206208
do {
207209
var driver = try Driver.forTesting(args: ["swiftc", "-print-target-info", "-tools-directory", toolsDirectory.pathString],
208-
env: [PATH: tempDirectory.pathString, SWIFT_SCANNER_LIB: customSwiftScan.pathString])
210+
env: [PATH: tempDirectory.pathString, SWIFT_SCANNER_LIB: customSwiftScan.pathString],
211+
fileSystem: fs)
209212
let jobs = try driver.planBuild()
210213
#expect(jobs.count == 1)
211214
expectEqual(jobs.first!.tool.name, customSwiftFrontend.pathString)
@@ -219,8 +222,8 @@ import CRT
219222
let separator = ":"
220223
#endif
221224
var driver = try Driver.forTesting(args: ["swiftc", "-print-target-info"],
222-
cwd: tempDirectory,
223-
env: [PATH: [toolsDirectory.pathString, ProcessEnv.path!].joined(separator: separator), SWIFT_SCANNER_LIB: customSwiftScan.pathString])
225+
env: [PATH: [toolsDirectory.pathString, ProcessEnv.path!].joined(separator: separator), SWIFT_SCANNER_LIB: customSwiftScan.pathString],
226+
fileSystem: fs)
224227
let jobs = try driver.planBuild()
225228
#expect(jobs.count == 1)
226229
expectEqual(jobs.first!.tool.name, anotherSwiftFrontend.pathString)

0 commit comments

Comments
 (0)