@@ -289,7 +289,7 @@ final class NonincrementalCompilationTests: XCTestCase {
289289
290290final class IncrementalCompilationTests : XCTestCase {
291291
292- let tempDir : AbsolutePath
292+ var tempDir : AbsolutePath = AbsolutePath ( " /tmp " )
293293
294294 let module = " theModule "
295295 var OFM : AbsolutePath {
@@ -336,19 +336,17 @@ final class IncrementalCompilationTests: XCTestCase {
336336 ]
337337 + inputPathsAndContents. map { $0. 0 . pathString} . sorted ( )
338338 }
339-
340- override init ( selector: Selector ) {
341- // Prefix directory with test name to ensure directory name is unique when
342- // testing in parallel.
343- self . tempDir = try ! withTemporaryDirectory ( prefix: selector. description, removeTreeOnDeinit: false ) { $0}
344- super. init ( selector: selector)
345- }
346-
347339 deinit {
348340 try ? localFileSystem. removeFileTree ( tempDir)
349341 }
350342
351343 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}
352350 try ! localFileSystem. createDirectory ( derivedDataPath)
353351 writeOutputFileMapData ( module: module,
354352 inputPaths: inputPathsAndContents. map { $0. 0 } ,
0 commit comments