Skip to content

Commit a1737ce

Browse files
author
David Ungar
committed
Ensure temp dir is different between testIncremental and testIncrementalDiagnostics to see if that fixes the test breakage in CI
1 parent de4c66b commit a1737ce

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Tests/SwiftDriverTests/IncrementalCompilationTests.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,9 @@ final class IncrementalCompilationTests: XCTestCase {
340340
try? localFileSystem.removeFileTree(tempDir)
341341
}
342342

343-
override func setUp() {
344-
self.tempDir = try! withTemporaryDirectory(removeTreeOnDeinit: false) {$0}
343+
func prepare(line: Int = #line) {
344+
// ensure tempDir is unique by using line prefix
345+
self.tempDir = try! withTemporaryDirectory(prefix: line.description, removeTreeOnDeinit: false) {$0}
345346
try! localFileSystem.createDirectory(derivedDataPath)
346347
writeOutputFileMapData(module: module,
347348
inputPaths: inputPathsAndContents.map {$0.0},
@@ -358,11 +359,13 @@ final class IncrementalCompilationTests: XCTestCase {
358359
// FIXME: why does it fail on Linux in CI?
359360
func testIncrementalDiagnostics() throws {
360361
#if !os(Linux)
362+
prepare()
361363
try testIncremental(checkDiagnostics: true)
362364
#endif
363365
}
364366

365367
func testIncremental() throws {
368+
prepare()
366369
try testIncremental(checkDiagnostics: false)
367370
}
368371

@@ -553,6 +556,7 @@ final class IncrementalCompilationTests: XCTestCase {
553556
/// autolink job.
554557
/// Much of the code below is taking from testLinking(), but uses the output file map code here.
555558
func testAutolinkOutputPath() {
559+
prepare()
556560
var env = ProcessEnv.vars
557561
env["SWIFT_DRIVER_TESTS_ENABLE_EXEC_PATH_FALLBACK"] = "1"
558562
env["SWIFT_DRIVER_SWIFT_AUTOLINK_EXTRACT_EXEC"] = "/garbage/swift-autolink-extract"

0 commit comments

Comments
 (0)