Skip to content

Commit 32eeb97

Browse files
author
David Ungar
committed
Address review
1 parent 7356075 commit 32eeb97

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Tests/SwiftDriverTests/IncrementalCompilationTests.swift

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

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}
343+
override func setUp() {
344+
// Prefix directory with test name to ensure directory name is unique when
345+
// testing in parallel.
346+
// name returns e.g. "[SwiftDriverTests.IncrementalCompilationTests testIncremental]
347+
// but we just want "testIncremental"
348+
let testName = name.split(separator: " ").last!.dropLast()
349+
self.tempDir = try! withTemporaryDirectory(prefix: String(testName), removeTreeOnDeinit: false) {$0}
346350
try! localFileSystem.createDirectory(derivedDataPath)
347351
writeOutputFileMapData(module: module,
348352
inputPaths: inputPathsAndContents.map {$0.0},
@@ -356,14 +360,11 @@ final class IncrementalCompilationTests: XCTestCase {
356360
}
357361
}
358362

359-
// FIXME: why does it fail on Linux in CI?
360363
func testIncrementalDiagnostics() throws {
361-
prepare()
362364
try testIncremental(checkDiagnostics: true)
363365
}
364366

365367
func testIncremental() throws {
366-
prepare()
367368
try testIncremental(checkDiagnostics: false)
368369
}
369370

@@ -554,7 +555,6 @@ final class IncrementalCompilationTests: XCTestCase {
554555
/// autolink job.
555556
/// Much of the code below is taking from testLinking(), but uses the output file map code here.
556557
func testAutolinkOutputPath() {
557-
prepare()
558558
var env = ProcessEnv.vars
559559
env["SWIFT_DRIVER_TESTS_ENABLE_EXEC_PATH_FALLBACK"] = "1"
560560
env["SWIFT_DRIVER_SWIFT_AUTOLINK_EXTRACT_EXEC"] = "/garbage/swift-autolink-extract"

0 commit comments

Comments
 (0)