Skip to content

Commit 3872595

Browse files
authored
Merge pull request #1528 from johnno1962a/test-imports
2 parents 2733f62 + 3f4fbe5 commit 3872595

File tree

84 files changed

+29
-750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+29
-750
lines changed

Foundation.xcodeproj/project.pbxproj

+4
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@
344344
B9974B9A1EDF4A22007F15B8 /* HTTPMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9974B931EDF4A22007F15B8 /* HTTPMessage.swift */; };
345345
B9974B9B1EDF4A22007F15B8 /* BodySource.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9974B941EDF4A22007F15B8 /* BodySource.swift */; };
346346
B9974B9C1EDF4A22007F15B8 /* EasyHandle.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9974B951EDF4A22007F15B8 /* EasyHandle.swift */; };
347+
BB3D7558208A1E500085CFDC /* TestImports.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB3D7557208A1E500085CFDC /* TestImports.swift */; };
347348
BD8042161E09857800487EB8 /* TestLengthFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD8042151E09857800487EB8 /* TestLengthFormatter.swift */; };
348349
BDBB65901E256BFA001A7286 /* TestEnergyFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDBB658F1E256BFA001A7286 /* TestEnergyFormatter.swift */; };
349350
BDFDF0A71DFF5B3E00C04CC5 /* TestPersonNameComponents.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDFDF0A61DFF5B3E00C04CC5 /* TestPersonNameComponents.swift */; };
@@ -825,6 +826,7 @@
825826
B9974B931EDF4A22007F15B8 /* HTTPMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HTTPMessage.swift; path = http/HTTPMessage.swift; sourceTree = "<group>"; };
826827
B9974B941EDF4A22007F15B8 /* BodySource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BodySource.swift; sourceTree = "<group>"; };
827828
B9974B951EDF4A22007F15B8 /* EasyHandle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EasyHandle.swift; sourceTree = "<group>"; };
829+
BB3D7557208A1E500085CFDC /* TestImports.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestImports.swift; sourceTree = "<group>"; };
828830
BD8042151E09857800487EB8 /* TestLengthFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestLengthFormatter.swift; sourceTree = "<group>"; };
829831
BDBB658F1E256BFA001A7286 /* TestEnergyFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestEnergyFormatter.swift; sourceTree = "<group>"; };
830832
BDFDF0A61DFF5B3E00C04CC5 /* TestPersonNameComponents.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestPersonNameComponents.swift; sourceTree = "<group>"; };
@@ -1431,6 +1433,7 @@
14311433
children = (
14321434
1520469A1D8AEABE00D02E36 /* HTTPServer.swift */,
14331435
EA66F6381BF1619600136161 /* main.swift */,
1436+
BB3D7557208A1E500085CFDC /* TestImports.swift */,
14341437
9F4ADBCF1ECD4F56001F0B3D /* xdgTestHelper */,
14351438
EA66F65A1BF1976100136161 /* Tests */,
14361439
EA66F6391BF1619600136161 /* Resources */,
@@ -2442,6 +2445,7 @@
24422445
90E645DF1E4C89A400D0D47C /* TestNSCache.swift in Sources */,
24432446
5B13B34A1C582D4C00651CE2 /* TestURL.swift in Sources */,
24442447
EA54A6FB1DB16D53009E0809 /* TestObjCRuntime.swift in Sources */,
2448+
BB3D7558208A1E500085CFDC /* TestImports.swift in Sources */,
24452449
5B13B34D1C582D4C00651CE2 /* TestNSUUID.swift in Sources */,
24462450
5B13B3281C582D4C00651CE2 /* TestBundle.swift in Sources */,
24472451
5B13B32A1C582D4C00651CE2 /* TestCharacterSet.swift in Sources */,

TestFoundation/HTTPServer.swift

+2-10
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@
1414

1515
import Dispatch
1616

17-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
18-
import Foundation
19-
import XCTest
20-
#else
21-
import SwiftFoundation
22-
import SwiftXCTest
23-
#endif
24-
25-
#if os(macOS) || os(iOS)
17+
#if canImport(Darwin)
2618
import Darwin
27-
#elseif os(Linux)
19+
#elseif canImport(Glibc)
2820
import Glibc
2921
#endif
3022

TestFoundation/TestAffineTransform.swift

-11
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
11-
12-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
13-
import Foundation
14-
import XCTest
15-
#else
16-
import SwiftFoundation
17-
import SwiftXCTest
18-
#endif
19-
20-
2110
class TestAffineTransform : XCTestCase {
2211
private let accuracyThreshold = 0.001
2312

TestFoundation/TestBundle.swift

-9
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
11-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
12-
import Foundation
13-
import XCTest
14-
#else
15-
import SwiftFoundation
16-
import SwiftXCTest
17-
#endif
18-
1910
import CoreFoundation
2011

2112
internal func testBundle() -> Bundle {

TestFoundation/TestByteCountFormatter.swift

-12
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
11-
12-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
13-
import Foundation
14-
import XCTest
15-
#else
16-
import SwiftFoundation
17-
import SwiftXCTest
18-
#endif
19-
20-
21-
2210
class TestByteCountFormatter : XCTestCase {
2311

2412
static var allTests: [(String, (TestByteCountFormatter) -> () throws -> Void)] {

TestFoundation/TestCalendar.swift

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
17-
1810
class TestCalendar: XCTestCase {
1911

2012
static var allTests: [(String, (TestCalendar) -> () throws -> Void)] {

TestFoundation/TestCharacterSet.swift

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
17-
1810
private struct Box: Equatable {
1911
private let ns: NSCharacterSet
2012
private let swift: CharacterSet

TestFoundation/TestCodable.swift

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
17-
1810
// MARK: - Helper Functions
1911

2012
private func makePersonNameComponents(namePrefix: String? = nil,

TestFoundation/TestDate.swift

-12
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
11-
12-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
13-
import Foundation
14-
import XCTest
15-
#else
16-
import SwiftFoundation
17-
import SwiftXCTest
18-
#endif
19-
20-
21-
2210
class TestDate : XCTestCase {
2311

2412
static var allTests: [(String, (TestDate) -> () throws -> Void)] {

TestFoundation/TestDateFormatter.swift

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
17-
1810
class TestDateFormatter: XCTestCase {
1911

2012
let DEFAULT_LOCALE = "en_US"

TestFoundation/TestDecimal.swift

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
17-
1810
class TestDecimal: XCTestCase {
1911

2012
static var allTests : [(String, (TestDecimal) -> () throws -> Void)] {

TestFoundation/TestEnergyFormatter.swift

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
17-
1810
class TestEnergyFormatter: XCTestCase {
1911
let formatter: EnergyFormatter = EnergyFormatter()
2012

TestFoundation/TestFileHandle.swift

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
17-
1810
class TestFileHandle : XCTestCase {
1911
static var allTests : [(String, (TestFileHandle) -> () throws -> ())] {
2012
return [

TestFoundation/TestFileManager.swift

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
17-
1810
class TestFileManager : XCTestCase {
1911

2012
static var allTests: [(String, (TestFileManager) -> () throws -> Void)] {

TestFoundation/TestHTTPCookie.swift

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
17-
1810
class TestHTTPCookie: XCTestCase {
1911

2012
static var allTests: [(String, (TestHTTPCookie) -> () throws -> Void)] {

TestFoundation/TestHTTPCookieStorage.swift

-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
1710
import Dispatch
1811

1912
class TestHTTPCookieStorage: XCTestCase {

TestFoundation/TestHost.swift

-10
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
11-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
12-
import Foundation
13-
import XCTest
14-
#else
15-
import SwiftFoundation
16-
import SwiftXCTest
17-
#endif
18-
19-
2010
class TestHost: XCTestCase {
2111

2212
static var allTests: [(String, (TestHost) -> () throws -> Void)] {

TestFoundation/TestISO8601DateFormatter.swift

-10
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
11-
12-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
13-
import Foundation
14-
import XCTest
15-
#else
16-
import SwiftFoundation
17-
import SwiftXCTest
18-
#endif
19-
2010
class TestISO8601DateFormatter: XCTestCase {
2111

2212
static var allTests : [(String, (TestISO8601DateFormatter) -> () throws -> Void)] {

TestFoundation/TestImports.swift

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This source file is part of the Swift.org open source project
2+
//
3+
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
4+
// Licensed under Apache License v2.0 with Runtime Library Exception
5+
//
6+
// See http://swift.org/LICENSE.txt for license information
7+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8+
//
9+
10+
// Centralized conditional imports for all test sources
11+
12+
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) || os(Android)
13+
@_exported import Foundation
14+
@_exported import XCTest
15+
#else
16+
@_exported import SwiftFoundation
17+
@_exported import SwiftXCTest
18+
#endif

TestFoundation/TestIndexPath.swift

-10
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
11-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
12-
import Foundation
13-
import XCTest
14-
#else
15-
import SwiftFoundation
16-
import SwiftXCTest
17-
#endif
18-
19-
2010
class TestIndexPath: XCTestCase {
2111

2212
static var allTests: [(String, (TestIndexPath) -> () throws -> Void)] {

TestFoundation/TestIndexSet.swift

-10
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
11-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
12-
import Foundation
13-
import XCTest
14-
#else
15-
import SwiftFoundation
16-
import SwiftXCTest
17-
#endif
18-
19-
2010
class TestIndexSet : XCTestCase {
2111

2212
static var allTests: [(String, (TestIndexSet) -> () throws -> Void)] {

TestFoundation/TestJSONEncoder.swift

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
11-
import Foundation
12-
import XCTest
13-
#else
14-
import SwiftFoundation
15-
import SwiftXCTest
16-
#endif
17-
1810
struct TopLevelObjectWrapper<T: Codable & Equatable>: Codable, Equatable {
1911
var value: T
2012

TestFoundation/TestJSONSerialization.swift

-9
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
11-
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
12-
import Foundation
13-
import XCTest
14-
#else
15-
import SwiftFoundation
16-
import SwiftXCTest
17-
#endif
18-
1910
// Exposing internal ReadingOptions for tests.
2011
extension JSONSerialization.ReadingOptions {
2112
fileprivate static let useReferenceNumericTypes = JSONSerialization.ReadingOptions(rawValue: 1 << 15)

0 commit comments

Comments
 (0)