Skip to content

Commit 7337331

Browse files
authored
Merge pull request #1986 from compnerd/can-haz-import
TestFoundation: give preference to SwiftFoundation, SwiftXCTest
2 parents 89de36e + 90d5520 commit 7337331

File tree

5 files changed

+17
-19
lines changed

5 files changed

+17
-19
lines changed

TestFoundation/TestDateIntervalFormatter.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
//
99

1010
#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
11-
#if (os(Linux) || os(Android))
12-
@testable import Foundation
13-
#else
11+
#if canImport(SwiftFoundation) && !DEPLOYMENT_RUNTIME_OBJC
1412
@testable import SwiftFoundation
13+
#else
14+
@testable import Foundation
1515
#endif
1616
#endif
1717

TestFoundation/TestFileManager.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
//
99

1010
#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
11-
#if (os(Linux) || os(Android))
12-
@testable import Foundation
13-
#else
11+
#if canImport(SwiftFoundation) && !DEPLOYMENT_RUNTIME_OBJC
1412
@testable import SwiftFoundation
13+
#else
14+
@testable import Foundation
1515
#endif
1616
#endif
1717

TestFoundation/TestImports.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
// Centralized conditional imports for all test sources
1111

12-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) || os(Android)
13-
@_exported import Foundation
14-
@_exported import XCTest
15-
#else
12+
#if !DEPLOYMENT_RUNTIME_OBJC && canImport(SwiftFoundation) && canImport(SwiftXCTest)
1613
@_exported import SwiftFoundation
1714
@_exported import SwiftXCTest
15+
#else
16+
@_exported import Foundation
17+
@_exported import XCTest
1818
#endif

TestFoundation/TestStream.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
11-
#if canImport(SwiftFoundation)
12-
@testable import SwiftFoundation
13-
#else
14-
@testable import Foundation
15-
#endif
10+
#if canImport(SwiftFoundation) && !DEPLOYMENT_RUNTIME_OBJC
11+
@testable import SwiftFoundation
12+
#else
13+
@testable import Foundation
1614
#endif
1715

1816

TestFoundation/xdgTestHelper/main.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) || os(Android)
11-
import Foundation
12-
#else
10+
#if canImport(SwiftFoundation) && !DEPLOYMENT_RUNTIME_OBJC
1311
import SwiftFoundation
12+
#else
13+
import Foundation
1414
#endif
1515

1616
enum HelperCheckStatus : Int32 {

0 commit comments

Comments
 (0)