From c2df62e7c1f98f0a444d84e454baa0583a3449f6 Mon Sep 17 00:00:00 2001 From: John Holdsworth Date: Fri, 20 Apr 2018 14:26:53 +0100 Subject: [PATCH 1/2] Centralise test imports and add os(Android) --- Foundation.xcodeproj/project.pbxproj | 4 ++++ TestFoundation/HTTPServer.swift | 8 -------- TestFoundation/TestAffineTransform.swift | 11 ----------- TestFoundation/TestBundle.swift | 9 --------- TestFoundation/TestByteCountFormatter.swift | 12 ------------ TestFoundation/TestCalendar.swift | 8 -------- TestFoundation/TestCharacterSet.swift | 8 -------- TestFoundation/TestCodable.swift | 8 -------- TestFoundation/TestDate.swift | 12 ------------ TestFoundation/TestDateFormatter.swift | 8 -------- TestFoundation/TestDecimal.swift | 8 -------- TestFoundation/TestEnergyFormatter.swift | 8 -------- TestFoundation/TestFileHandle.swift | 8 -------- TestFoundation/TestFileManager.swift | 8 -------- TestFoundation/TestHTTPCookie.swift | 8 -------- TestFoundation/TestHTTPCookieStorage.swift | 7 ------- TestFoundation/TestHost.swift | 10 ---------- TestFoundation/TestISO8601DateFormatter.swift | 10 ---------- TestFoundation/TestImports.swift | 18 ++++++++++++++++++ TestFoundation/TestIndexPath.swift | 10 ---------- TestFoundation/TestIndexSet.swift | 10 ---------- TestFoundation/TestJSONEncoder.swift | 8 -------- TestFoundation/TestJSONSerialization.swift | 9 --------- TestFoundation/TestLengthFormatter.swift | 8 -------- TestFoundation/TestMassFormatter.swift | 8 -------- TestFoundation/TestNSArray.swift | 12 ------------ TestFoundation/TestNSAttributedString.swift | 11 ----------- TestFoundation/TestNSCache.swift | 8 -------- TestFoundation/TestNSCompoundPredicate.swift | 8 -------- TestFoundation/TestNSData.swift | 8 -------- TestFoundation/TestNSDictionary.swift | 12 ------------ TestFoundation/TestNSError.swift | 9 --------- TestFoundation/TestNSGeometry.swift | 9 --------- TestFoundation/TestNSKeyedArchiver.swift | 9 --------- TestFoundation/TestNSKeyedUnarchiver.swift | 10 ---------- TestFoundation/TestNSLocale.swift | 8 -------- TestFoundation/TestNSLock.swift | 8 -------- TestFoundation/TestNSNull.swift | 12 ------------ TestFoundation/TestNSNumber.swift | 10 ---------- TestFoundation/TestNSNumberBridging.swift | 9 --------- TestFoundation/TestNSOrderedSet.swift | 12 ------------ TestFoundation/TestNSPredicate.swift | 8 -------- TestFoundation/TestNSProgressFraction.swift | 8 -------- TestFoundation/TestNSRange.swift | 10 ---------- TestFoundation/TestNSRegularExpression.swift | 12 ------------ TestFoundation/TestNSSet.swift | 12 ------------ TestFoundation/TestNSString.swift | 9 --------- TestFoundation/TestNSTextCheckingResult.swift | 10 ---------- TestFoundation/TestNSURLRequest.swift | 9 --------- TestFoundation/TestNSUUID.swift | 10 ---------- TestFoundation/TestNSValue.swift | 10 ---------- TestFoundation/TestNotification.swift | 12 ------------ TestFoundation/TestNotificationCenter.swift | 10 ---------- TestFoundation/TestNotificationQueue.swift | 9 --------- TestFoundation/TestNumberFormatter.swift | 8 -------- TestFoundation/TestObjCRuntime.swift | 8 -------- TestFoundation/TestOperationQueue.swift | 9 --------- TestFoundation/TestPersonNameComponents.swift | 10 ---------- TestFoundation/TestPipe.swift | 10 ---------- TestFoundation/TestProcess.swift | 8 -------- TestFoundation/TestProcessInfo.swift | 10 ---------- TestFoundation/TestProgress.swift | 8 -------- .../TestPropertyListSerialization.swift | 11 ----------- TestFoundation/TestRunLoop.swift | 9 --------- TestFoundation/TestScanner.swift | 12 ------------ TestFoundation/TestStream.swift | 8 -------- TestFoundation/TestThread.swift | 9 --------- TestFoundation/TestTimeZone.swift | 12 ------------ TestFoundation/TestTimer.swift | 10 ---------- TestFoundation/TestURL.swift | 10 ---------- TestFoundation/TestURLCredential.swift | 9 --------- TestFoundation/TestURLProtocol.swift | 7 ------- TestFoundation/TestURLRequest.swift | 9 --------- TestFoundation/TestURLResponse.swift | 10 ---------- TestFoundation/TestURLSession.swift | 8 -------- TestFoundation/TestUnit.swift | 8 -------- TestFoundation/TestUnitConverter.swift | 10 ---------- TestFoundation/TestUserDefaults.swift | 8 -------- TestFoundation/TestUtils.swift | 8 -------- TestFoundation/TestXMLDocument.swift | 10 ---------- TestFoundation/TestXMLParser.swift | 9 --------- TestFoundation/XDGTestHelper.swift | 6 ------ TestFoundation/main.swift | 11 ++--------- TestFoundation/xdgTestHelper/main.swift | 6 ------ 84 files changed, 24 insertions(+), 757 deletions(-) create mode 100644 TestFoundation/TestImports.swift diff --git a/Foundation.xcodeproj/project.pbxproj b/Foundation.xcodeproj/project.pbxproj index 0eeae8889a..46817e8365 100644 --- a/Foundation.xcodeproj/project.pbxproj +++ b/Foundation.xcodeproj/project.pbxproj @@ -344,6 +344,7 @@ B9974B9A1EDF4A22007F15B8 /* HTTPMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9974B931EDF4A22007F15B8 /* HTTPMessage.swift */; }; B9974B9B1EDF4A22007F15B8 /* BodySource.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9974B941EDF4A22007F15B8 /* BodySource.swift */; }; B9974B9C1EDF4A22007F15B8 /* EasyHandle.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9974B951EDF4A22007F15B8 /* EasyHandle.swift */; }; + BB3D7558208A1E500085CFDC /* TestImports.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB3D7557208A1E500085CFDC /* TestImports.swift */; }; BD8042161E09857800487EB8 /* TestLengthFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD8042151E09857800487EB8 /* TestLengthFormatter.swift */; }; BDBB65901E256BFA001A7286 /* TestEnergyFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDBB658F1E256BFA001A7286 /* TestEnergyFormatter.swift */; }; BDFDF0A71DFF5B3E00C04CC5 /* TestPersonNameComponents.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDFDF0A61DFF5B3E00C04CC5 /* TestPersonNameComponents.swift */; }; @@ -825,6 +826,7 @@ B9974B931EDF4A22007F15B8 /* HTTPMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HTTPMessage.swift; path = http/HTTPMessage.swift; sourceTree = ""; }; B9974B941EDF4A22007F15B8 /* BodySource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BodySource.swift; sourceTree = ""; }; B9974B951EDF4A22007F15B8 /* EasyHandle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EasyHandle.swift; sourceTree = ""; }; + BB3D7557208A1E500085CFDC /* TestImports.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestImports.swift; sourceTree = ""; }; BD8042151E09857800487EB8 /* TestLengthFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestLengthFormatter.swift; sourceTree = ""; }; BDBB658F1E256BFA001A7286 /* TestEnergyFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestEnergyFormatter.swift; sourceTree = ""; }; BDFDF0A61DFF5B3E00C04CC5 /* TestPersonNameComponents.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestPersonNameComponents.swift; sourceTree = ""; }; @@ -1431,6 +1433,7 @@ children = ( 1520469A1D8AEABE00D02E36 /* HTTPServer.swift */, EA66F6381BF1619600136161 /* main.swift */, + BB3D7557208A1E500085CFDC /* TestImports.swift */, 9F4ADBCF1ECD4F56001F0B3D /* xdgTestHelper */, EA66F65A1BF1976100136161 /* Tests */, EA66F6391BF1619600136161 /* Resources */, @@ -2442,6 +2445,7 @@ 90E645DF1E4C89A400D0D47C /* TestNSCache.swift in Sources */, 5B13B34A1C582D4C00651CE2 /* TestURL.swift in Sources */, EA54A6FB1DB16D53009E0809 /* TestObjCRuntime.swift in Sources */, + BB3D7558208A1E500085CFDC /* TestImports.swift in Sources */, 5B13B34D1C582D4C00651CE2 /* TestNSUUID.swift in Sources */, 5B13B3281C582D4C00651CE2 /* TestBundle.swift in Sources */, 5B13B32A1C582D4C00651CE2 /* TestCharacterSet.swift in Sources */, diff --git a/TestFoundation/HTTPServer.swift b/TestFoundation/HTTPServer.swift index 656dbd3808..34a1f882a2 100644 --- a/TestFoundation/HTTPServer.swift +++ b/TestFoundation/HTTPServer.swift @@ -14,14 +14,6 @@ import Dispatch -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - #if os(macOS) || os(iOS) import Darwin #elseif os(Linux) diff --git a/TestFoundation/TestAffineTransform.swift b/TestFoundation/TestAffineTransform.swift index 86da70fe4e..abc4c8518e 100644 --- a/TestFoundation/TestAffineTransform.swift +++ b/TestFoundation/TestAffineTransform.swift @@ -7,17 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestAffineTransform : XCTestCase { private let accuracyThreshold = 0.001 diff --git a/TestFoundation/TestBundle.swift b/TestFoundation/TestBundle.swift index 68690ff32e..e0a4844689 100644 --- a/TestFoundation/TestBundle.swift +++ b/TestFoundation/TestBundle.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - import CoreFoundation internal func testBundle() -> Bundle { diff --git a/TestFoundation/TestByteCountFormatter.swift b/TestFoundation/TestByteCountFormatter.swift index c07726689c..97161b2fcd 100644 --- a/TestFoundation/TestByteCountFormatter.swift +++ b/TestFoundation/TestByteCountFormatter.swift @@ -7,18 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - - class TestByteCountFormatter : XCTestCase { static var allTests: [(String, (TestByteCountFormatter) -> () throws -> Void)] { diff --git a/TestFoundation/TestCalendar.swift b/TestFoundation/TestCalendar.swift index 4101b8ba75..aed09454c1 100644 --- a/TestFoundation/TestCalendar.swift +++ b/TestFoundation/TestCalendar.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - class TestCalendar: XCTestCase { static var allTests: [(String, (TestCalendar) -> () throws -> Void)] { diff --git a/TestFoundation/TestCharacterSet.swift b/TestFoundation/TestCharacterSet.swift index 157a306648..7b2b00a7f2 100644 --- a/TestFoundation/TestCharacterSet.swift +++ b/TestFoundation/TestCharacterSet.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - private struct Box: Equatable { private let ns: NSCharacterSet private let swift: CharacterSet diff --git a/TestFoundation/TestCodable.swift b/TestFoundation/TestCodable.swift index 63d827183d..6726183063 100644 --- a/TestFoundation/TestCodable.swift +++ b/TestFoundation/TestCodable.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - // MARK: - Helper Functions private func makePersonNameComponents(namePrefix: String? = nil, diff --git a/TestFoundation/TestDate.swift b/TestFoundation/TestDate.swift index 27010e06a4..5b75d7b535 100644 --- a/TestFoundation/TestDate.swift +++ b/TestFoundation/TestDate.swift @@ -7,18 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - - class TestDate : XCTestCase { static var allTests: [(String, (TestDate) -> () throws -> Void)] { diff --git a/TestFoundation/TestDateFormatter.swift b/TestFoundation/TestDateFormatter.swift index 04e625e280..2ba14339ae 100644 --- a/TestFoundation/TestDateFormatter.swift +++ b/TestFoundation/TestDateFormatter.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestDateFormatter: XCTestCase { let DEFAULT_LOCALE = "en_US" diff --git a/TestFoundation/TestDecimal.swift b/TestFoundation/TestDecimal.swift index 9fdba8daf8..cbd7cae890 100644 --- a/TestFoundation/TestDecimal.swift +++ b/TestFoundation/TestDecimal.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestDecimal: XCTestCase { static var allTests : [(String, (TestDecimal) -> () throws -> Void)] { diff --git a/TestFoundation/TestEnergyFormatter.swift b/TestFoundation/TestEnergyFormatter.swift index 20ee4f7a14..6ec4840c1f 100644 --- a/TestFoundation/TestEnergyFormatter.swift +++ b/TestFoundation/TestEnergyFormatter.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestEnergyFormatter: XCTestCase { let formatter: EnergyFormatter = EnergyFormatter() diff --git a/TestFoundation/TestFileHandle.swift b/TestFoundation/TestFileHandle.swift index 1b389ff0f7..ac7c4f4720 100644 --- a/TestFoundation/TestFileHandle.swift +++ b/TestFoundation/TestFileHandle.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestFileHandle : XCTestCase { static var allTests : [(String, (TestFileHandle) -> () throws -> ())] { return [ diff --git a/TestFoundation/TestFileManager.swift b/TestFoundation/TestFileManager.swift index 579d9865db..6729606a4b 100644 --- a/TestFoundation/TestFileManager.swift +++ b/TestFoundation/TestFileManager.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestFileManager : XCTestCase { static var allTests: [(String, (TestFileManager) -> () throws -> Void)] { diff --git a/TestFoundation/TestHTTPCookie.swift b/TestFoundation/TestHTTPCookie.swift index 51aff27c6c..5ca445fbaf 100644 --- a/TestFoundation/TestHTTPCookie.swift +++ b/TestFoundation/TestHTTPCookie.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestHTTPCookie: XCTestCase { static var allTests: [(String, (TestHTTPCookie) -> () throws -> Void)] { diff --git a/TestFoundation/TestHTTPCookieStorage.swift b/TestFoundation/TestHTTPCookieStorage.swift index 2a44e0dbe2..0339f2cf4a 100644 --- a/TestFoundation/TestHTTPCookieStorage.swift +++ b/TestFoundation/TestHTTPCookieStorage.swift @@ -7,13 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif import Dispatch class TestHTTPCookieStorage: XCTestCase { diff --git a/TestFoundation/TestHost.swift b/TestFoundation/TestHost.swift index 40b63d4da5..6cdb090363 100644 --- a/TestFoundation/TestHost.swift +++ b/TestFoundation/TestHost.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestHost: XCTestCase { static var allTests: [(String, (TestHost) -> () throws -> Void)] { diff --git a/TestFoundation/TestISO8601DateFormatter.swift b/TestFoundation/TestISO8601DateFormatter.swift index 9f6323ec5f..3511414a46 100644 --- a/TestFoundation/TestISO8601DateFormatter.swift +++ b/TestFoundation/TestISO8601DateFormatter.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestISO8601DateFormatter: XCTestCase { static var allTests : [(String, (TestISO8601DateFormatter) -> () throws -> Void)] { diff --git a/TestFoundation/TestImports.swift b/TestFoundation/TestImports.swift new file mode 100644 index 0000000000..60b48b6cf3 --- /dev/null +++ b/TestFoundation/TestImports.swift @@ -0,0 +1,18 @@ +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See http://swift.org/LICENSE.txt for license information +// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// + +// Centralized conditional imports for all test sources + +#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) || os(Android) +@_exported import Foundation +@_exported import XCTest +#else +@_exported import SwiftFoundation +@_exported import SwiftXCTest +#endif diff --git a/TestFoundation/TestIndexPath.swift b/TestFoundation/TestIndexPath.swift index c78e3cc6c4..bc4a6d1d86 100644 --- a/TestFoundation/TestIndexPath.swift +++ b/TestFoundation/TestIndexPath.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestIndexPath: XCTestCase { static var allTests: [(String, (TestIndexPath) -> () throws -> Void)] { diff --git a/TestFoundation/TestIndexSet.swift b/TestFoundation/TestIndexSet.swift index 9eff873125..1c8aac2744 100644 --- a/TestFoundation/TestIndexSet.swift +++ b/TestFoundation/TestIndexSet.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - - class TestIndexSet : XCTestCase { static var allTests: [(String, (TestIndexSet) -> () throws -> Void)] { diff --git a/TestFoundation/TestJSONEncoder.swift b/TestFoundation/TestJSONEncoder.swift index 915e3e3add..9932a0f8f9 100644 --- a/TestFoundation/TestJSONEncoder.swift +++ b/TestFoundation/TestJSONEncoder.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - struct TopLevelObjectWrapper: Codable, Equatable { var value: T diff --git a/TestFoundation/TestJSONSerialization.swift b/TestFoundation/TestJSONSerialization.swift index 282c77709e..eff4ea0dd4 100644 --- a/TestFoundation/TestJSONSerialization.swift +++ b/TestFoundation/TestJSONSerialization.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - // Exposing internal ReadingOptions for tests. extension JSONSerialization.ReadingOptions { fileprivate static let useReferenceNumericTypes = JSONSerialization.ReadingOptions(rawValue: 1 << 15) diff --git a/TestFoundation/TestLengthFormatter.swift b/TestFoundation/TestLengthFormatter.swift index c99d305992..e01c34b2ed 100644 --- a/TestFoundation/TestLengthFormatter.swift +++ b/TestFoundation/TestLengthFormatter.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestLengthFormatter: XCTestCase { let formatter: LengthFormatter = LengthFormatter() diff --git a/TestFoundation/TestMassFormatter.swift b/TestFoundation/TestMassFormatter.swift index e465b1e121..84c8a46ba1 100644 --- a/TestFoundation/TestMassFormatter.swift +++ b/TestFoundation/TestMassFormatter.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestMassFormatter: XCTestCase { let formatter: MassFormatter = MassFormatter() diff --git a/TestFoundation/TestNSArray.swift b/TestFoundation/TestNSArray.swift index b292c41728..b37aea9aa4 100644 --- a/TestFoundation/TestNSArray.swift +++ b/TestFoundation/TestNSArray.swift @@ -7,18 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - - - class TestNSArray : XCTestCase { static var allTests: [(String, (TestNSArray) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSAttributedString.swift b/TestFoundation/TestNSAttributedString.swift index 308b5958dd..c98c40c9bb 100644 --- a/TestFoundation/TestNSAttributedString.swift +++ b/TestFoundation/TestNSAttributedString.swift @@ -7,17 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestNSAttributedString : XCTestCase { static var allTests: [(String, (TestNSAttributedString) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSCache.swift b/TestFoundation/TestNSCache.swift index 76ec60b1b0..b66b48c8a9 100644 --- a/TestFoundation/TestNSCache.swift +++ b/TestFoundation/TestNSCache.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestNSCache : XCTestCase { static var allTests: [(String, (TestNSCache) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSCompoundPredicate.swift b/TestFoundation/TestNSCompoundPredicate.swift index c5647ba2fb..23407d6339 100644 --- a/TestFoundation/TestNSCompoundPredicate.swift +++ b/TestFoundation/TestNSCompoundPredicate.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestNSCompoundPredicate: XCTestCase { static var allTests: [(String, (TestNSCompoundPredicate) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSData.swift b/TestFoundation/TestNSData.swift index 5c5eb96693..ff091228a7 100644 --- a/TestFoundation/TestNSData.swift +++ b/TestFoundation/TestNSData.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestNSData: LoopbackServerTest { class AllOnesImmutableData : NSData { diff --git a/TestFoundation/TestNSDictionary.swift b/TestFoundation/TestNSDictionary.swift index fb342488a6..c68655968f 100644 --- a/TestFoundation/TestNSDictionary.swift +++ b/TestFoundation/TestNSDictionary.swift @@ -7,18 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - - - class TestNSDictionary : XCTestCase { static var allTests: [(String, (TestNSDictionary) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSError.swift b/TestFoundation/TestNSError.swift index 16094bbef7..2337a5b29d 100644 --- a/TestFoundation/TestNSError.swift +++ b/TestFoundation/TestNSError.swift @@ -7,15 +7,6 @@ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - struct SwiftCustomNSError: Error, CustomNSError { } diff --git a/TestFoundation/TestNSGeometry.swift b/TestFoundation/TestNSGeometry.swift index 3c662f99d3..977f398144 100644 --- a/TestFoundation/TestNSGeometry.swift +++ b/TestFoundation/TestNSGeometry.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - private func assertEqual(_ rect: CGRect, x: CGFloat, y: CGFloat, diff --git a/TestFoundation/TestNSKeyedArchiver.swift b/TestFoundation/TestNSKeyedArchiver.swift index 7d2eaf5c90..3468f83102 100644 --- a/TestFoundation/TestNSKeyedArchiver.swift +++ b/TestFoundation/TestNSKeyedArchiver.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - public class NSUserClass : NSObject, NSSecureCoding { var ivar : Int diff --git a/TestFoundation/TestNSKeyedUnarchiver.swift b/TestFoundation/TestNSKeyedUnarchiver.swift index 51b494f862..6f9007dc31 100644 --- a/TestFoundation/TestNSKeyedUnarchiver.swift +++ b/TestFoundation/TestNSKeyedUnarchiver.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestNSKeyedUnarchiver : XCTestCase { static var allTests: [(String, (TestNSKeyedUnarchiver) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestNSLocale.swift b/TestFoundation/TestNSLocale.swift index e29449670c..8f72bbc359 100644 --- a/TestFoundation/TestNSLocale.swift +++ b/TestFoundation/TestNSLocale.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestNSLocale : XCTestCase { static var allTests: [(String, (TestNSLocale) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestNSLock.swift b/TestFoundation/TestNSLock.swift index 5334ff0cd8..a86365815b 100644 --- a/TestFoundation/TestNSLock.swift +++ b/TestFoundation/TestNSLock.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - class TestNSLock: XCTestCase { static var allTests: [(String, (TestNSLock) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestNSNull.swift b/TestFoundation/TestNSNull.swift index 08cc7c94ba..50eddeda9a 100644 --- a/TestFoundation/TestNSNull.swift +++ b/TestFoundation/TestNSNull.swift @@ -7,18 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - - class TestNSNull : XCTestCase { static var allTests: [(String, (TestNSNull) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSNumber.swift b/TestFoundation/TestNSNumber.swift index 8dc25a0183..597d97c347 100644 --- a/TestFoundation/TestNSNumber.swift +++ b/TestFoundation/TestNSNumber.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - - class TestNSNumber : XCTestCase { static var allTests: [(String, (TestNSNumber) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestNSNumberBridging.swift b/TestFoundation/TestNSNumberBridging.swift index 986a67406c..57978b1fbc 100644 --- a/TestFoundation/TestNSNumberBridging.swift +++ b/TestFoundation/TestNSNumberBridging.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - class TestNSNumberBridging : XCTestCase { static var allTests: [(String, (TestNSNumberBridging) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestNSOrderedSet.swift b/TestFoundation/TestNSOrderedSet.swift index 855c901fe1..d8b3231fa9 100644 --- a/TestFoundation/TestNSOrderedSet.swift +++ b/TestFoundation/TestNSOrderedSet.swift @@ -7,18 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - - class TestNSOrderedSet : XCTestCase { static var allTests: [(String, (TestNSOrderedSet) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSPredicate.swift b/TestFoundation/TestNSPredicate.swift index 4e88e33e42..3e755dc506 100644 --- a/TestFoundation/TestNSPredicate.swift +++ b/TestFoundation/TestNSPredicate.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestNSPredicate: XCTestCase { static var allTests : [(String, (TestNSPredicate) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSProgressFraction.swift b/TestFoundation/TestNSProgressFraction.swift index 7dcdd65990..05a6e3817a 100644 --- a/TestFoundation/TestNSProgressFraction.swift +++ b/TestFoundation/TestNSProgressFraction.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - #if !DARWIN_COMPATIBILITY_TESTS class TestProgressFraction : XCTestCase { static var allTests: [(String, (TestProgressFraction) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSRange.swift b/TestFoundation/TestNSRange.swift index 5574d3488e..8b3870fd2a 100644 --- a/TestFoundation/TestNSRange.swift +++ b/TestFoundation/TestNSRange.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - - class TestNSRange : XCTestCase { static var allTests: [(String, (TestNSRange) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSRegularExpression.swift b/TestFoundation/TestNSRegularExpression.swift index 55edf21788..419ba3b3ec 100644 --- a/TestFoundation/TestNSRegularExpression.swift +++ b/TestFoundation/TestNSRegularExpression.swift @@ -7,18 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - - - class TestNSRegularExpression : XCTestCase { static var allTests : [(String, (TestNSRegularExpression) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSSet.swift b/TestFoundation/TestNSSet.swift index 8b27af26ca..f6d5c5a688 100644 --- a/TestFoundation/TestNSSet.swift +++ b/TestFoundation/TestNSSet.swift @@ -7,18 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - - - class TestNSSet : XCTestCase { static var allTests: [(String, (TestNSSet) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSString.swift b/TestFoundation/TestNSString.swift index e63edd9184..eb9184319e 100755 --- a/TestFoundation/TestNSString.swift +++ b/TestFoundation/TestNSString.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - import CoreFoundation #if os(macOS) || os(iOS) diff --git a/TestFoundation/TestNSTextCheckingResult.swift b/TestFoundation/TestNSTextCheckingResult.swift index a631434f59..303045577b 100644 --- a/TestFoundation/TestNSTextCheckingResult.swift +++ b/TestFoundation/TestNSTextCheckingResult.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestNSTextCheckingResult: XCTestCase { static var allTests: [(String, (TestNSTextCheckingResult) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestNSURLRequest.swift b/TestFoundation/TestNSURLRequest.swift index 01bc34e741..da10012c76 100644 --- a/TestFoundation/TestNSURLRequest.swift +++ b/TestFoundation/TestNSURLRequest.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestNSURLRequest : XCTestCase { static var allTests: [(String, (TestNSURLRequest) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSUUID.swift b/TestFoundation/TestNSUUID.swift index 8122357955..47a17fe7ca 100644 --- a/TestFoundation/TestNSUUID.swift +++ b/TestFoundation/TestNSUUID.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestNSUUID : XCTestCase { static var allTests: [(String, (TestNSUUID) -> () throws -> Void)] { diff --git a/TestFoundation/TestNSValue.swift b/TestFoundation/TestNSValue.swift index 367485f3ea..7ebba664e4 100644 --- a/TestFoundation/TestNSValue.swift +++ b/TestFoundation/TestNSValue.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestNSValue : XCTestCase { static var allTests: [(String, (TestNSValue) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestNotification.swift b/TestFoundation/TestNotification.swift index 9c1bd38fac..8044e31a30 100644 --- a/TestFoundation/TestNotification.swift +++ b/TestFoundation/TestNotification.swift @@ -7,18 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - - class TestNotification : XCTestCase { static var allTests: [(String, (TestNotification) -> () throws -> Void)] { diff --git a/TestFoundation/TestNotificationCenter.swift b/TestFoundation/TestNotificationCenter.swift index 76c7052786..c94b109044 100644 --- a/TestFoundation/TestNotificationCenter.swift +++ b/TestFoundation/TestNotificationCenter.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestNotificationCenter : XCTestCase { static var allTests: [(String, (TestNotificationCenter) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestNotificationQueue.swift b/TestFoundation/TestNotificationQueue.swift index 9bde72607f..f1440ff0b8 100644 --- a/TestFoundation/TestNotificationQueue.swift +++ b/TestFoundation/TestNotificationQueue.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestNotificationQueue : XCTestCase { static var allTests : [(String, (TestNotificationQueue) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestNumberFormatter.swift b/TestFoundation/TestNumberFormatter.swift index 47c66a552d..c97c5ba32a 100644 --- a/TestFoundation/TestNumberFormatter.swift +++ b/TestFoundation/TestNumberFormatter.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestNumberFormatter: XCTestCase { static var allTests: [(String, (TestNumberFormatter) -> () throws -> Void)] { diff --git a/TestFoundation/TestObjCRuntime.swift b/TestFoundation/TestObjCRuntime.swift index 4af4094a16..324d5d0bba 100644 --- a/TestFoundation/TestObjCRuntime.swift +++ b/TestFoundation/TestObjCRuntime.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class SwiftClass { class InnerClass {} } diff --git a/TestFoundation/TestOperationQueue.swift b/TestFoundation/TestOperationQueue.swift index 1dd8c50a29..e78e68634f 100644 --- a/TestFoundation/TestOperationQueue.swift +++ b/TestFoundation/TestOperationQueue.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif import Dispatch class TestOperationQueue : XCTestCase { diff --git a/TestFoundation/TestPersonNameComponents.swift b/TestFoundation/TestPersonNameComponents.swift index a747e9ca85..ffbfae6662 100644 --- a/TestFoundation/TestPersonNameComponents.swift +++ b/TestFoundation/TestPersonNameComponents.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - private func assertEqual(_ lhs:PersonNameComponents, _ rhs: PersonNameComponents, file: StaticString = #file, diff --git a/TestFoundation/TestPipe.swift b/TestFoundation/TestPipe.swift index ea655b30ad..35dded6524 100644 --- a/TestFoundation/TestPipe.swift +++ b/TestFoundation/TestPipe.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - - class TestPipe : XCTestCase { static var allTests: [(String, (TestPipe) -> () throws -> Void)] { diff --git a/TestFoundation/TestProcess.swift b/TestFoundation/TestProcess.swift index 6af3e37df3..f450ebcb33 100644 --- a/TestFoundation/TestProcess.swift +++ b/TestFoundation/TestProcess.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestProcess : XCTestCase { static var allTests: [(String, (TestProcess) -> () throws -> Void)] { #if os(Android) diff --git a/TestFoundation/TestProcessInfo.swift b/TestFoundation/TestProcessInfo.swift index fee4e1d21b..e8e646c3da 100644 --- a/TestFoundation/TestProcessInfo.swift +++ b/TestFoundation/TestProcessInfo.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestProcessInfo : XCTestCase { static var allTests: [(String, (TestProcessInfo) -> () throws -> Void)] { diff --git a/TestFoundation/TestProgress.swift b/TestFoundation/TestProgress.swift index f9a9798098..8bf3708ad4 100644 --- a/TestFoundation/TestProgress.swift +++ b/TestFoundation/TestProgress.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - import Dispatch class TestProgress : XCTestCase { diff --git a/TestFoundation/TestPropertyListSerialization.swift b/TestFoundation/TestPropertyListSerialization.swift index 0f921b0488..8b02661f0c 100644 --- a/TestFoundation/TestPropertyListSerialization.swift +++ b/TestFoundation/TestPropertyListSerialization.swift @@ -7,17 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - - - class TestPropertyListSerialization : XCTestCase { static var allTests: [(String, (TestPropertyListSerialization) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestRunLoop.swift b/TestFoundation/TestRunLoop.swift index 9100b269f2..e427cde165 100644 --- a/TestFoundation/TestRunLoop.swift +++ b/TestFoundation/TestRunLoop.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestRunLoop : XCTestCase { static var allTests : [(String, (TestRunLoop) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestScanner.swift b/TestFoundation/TestScanner.swift index 2a1804ecc2..c2330b04eb 100644 --- a/TestFoundation/TestScanner.swift +++ b/TestFoundation/TestScanner.swift @@ -7,18 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - - class TestScanner : XCTestCase { static var allTests: [(String, (TestScanner) -> () throws -> Void)] { diff --git a/TestFoundation/TestStream.swift b/TestFoundation/TestStream.swift index 8584bba7b6..f1a6759c85 100644 --- a/TestFoundation/TestStream.swift +++ b/TestFoundation/TestStream.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestStream : XCTestCase { static var allTests: [(String, (TestStream) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestThread.swift b/TestFoundation/TestThread.swift index 4a73d095ff..68efcb63ec 100644 --- a/TestFoundation/TestThread.swift +++ b/TestFoundation/TestThread.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - #if !(os(macOS) || os(iOS)) import CoreFoundation #endif diff --git a/TestFoundation/TestTimeZone.swift b/TestFoundation/TestTimeZone.swift index 2bbb523fc8..e605fa03f1 100644 --- a/TestFoundation/TestTimeZone.swift +++ b/TestFoundation/TestTimeZone.swift @@ -7,18 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - - class TestTimeZone: XCTestCase { static var allTests: [(String, (TestTimeZone) -> () throws -> Void)] { diff --git a/TestFoundation/TestTimer.swift b/TestFoundation/TestTimer.swift index 677f620223..0e305b8b3d 100644 --- a/TestFoundation/TestTimer.swift +++ b/TestFoundation/TestTimer.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestTimer : XCTestCase { static var allTests : [(String, (TestTimer) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestURL.swift b/TestFoundation/TestURL.swift index 4f435a0158..6cdbcc4aa8 100644 --- a/TestFoundation/TestURL.swift +++ b/TestFoundation/TestURL.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif - - let kURLTestParsingTestsKey = "ParsingTests" let kURLTestTitleKey = "In-Title" diff --git a/TestFoundation/TestURLCredential.swift b/TestFoundation/TestURLCredential.swift index bcb588d624..eb33366996 100644 --- a/TestFoundation/TestURLCredential.swift +++ b/TestFoundation/TestURLCredential.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestURLCredential : XCTestCase { static var allTests: [(String, (TestURLCredential) -> () throws -> Void)] { diff --git a/TestFoundation/TestURLProtocol.swift b/TestFoundation/TestURLProtocol.swift index 2db78a076c..fcb964809a 100644 --- a/TestFoundation/TestURLProtocol.swift +++ b/TestFoundation/TestURLProtocol.swift @@ -6,13 +6,6 @@ // See http://swift.org/LICENSE.txt for license information // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif class TestURLProtocol : LoopbackServerTest { diff --git a/TestFoundation/TestURLRequest.swift b/TestFoundation/TestURLRequest.swift index e23ceacdf1..a5035c4eef 100644 --- a/TestFoundation/TestURLRequest.swift +++ b/TestFoundation/TestURLRequest.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestURLRequest : XCTestCase { static var allTests: [(String, (TestURLRequest) -> () throws -> Void)] { diff --git a/TestFoundation/TestURLResponse.swift b/TestFoundation/TestURLResponse.swift index 44fc95bbef..f2797ba457 100644 --- a/TestFoundation/TestURLResponse.swift +++ b/TestFoundation/TestURLResponse.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestURLResponse : XCTestCase { static var allTests: [(String, (TestURLResponse) -> () throws -> Void)] { return [ diff --git a/TestFoundation/TestURLSession.swift b/TestFoundation/TestURLSession.swift index 22bb0b9de6..161f9530dd 100644 --- a/TestFoundation/TestURLSession.swift +++ b/TestFoundation/TestURLSession.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestURLSession : LoopbackServerTest { static var allTests: [(String, (TestURLSession) -> () throws -> Void)] { diff --git a/TestFoundation/TestUnit.swift b/TestFoundation/TestUnit.swift index c934965729..6837974c24 100644 --- a/TestFoundation/TestUnit.swift +++ b/TestFoundation/TestUnit.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestUnit: XCTestCase { static var allTests: [(String, (TestUnit) -> () throws -> Void)] { diff --git a/TestFoundation/TestUnitConverter.swift b/TestFoundation/TestUnitConverter.swift index ed1d37477b..01545c5cdf 100644 --- a/TestFoundation/TestUnitConverter.swift +++ b/TestFoundation/TestUnitConverter.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - - class TestUnitConverter: XCTestCase { static var allTests: [(String, (TestUnitConverter) -> () throws -> Void)] { diff --git a/TestFoundation/TestUserDefaults.swift b/TestFoundation/TestUserDefaults.swift index dfba9bad52..9094fc7d6e 100644 --- a/TestFoundation/TestUserDefaults.swift +++ b/TestFoundation/TestUserDefaults.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - class TestUserDefaults : XCTestCase { static var allTests : [(String, (TestUserDefaults) -> () throws -> ())] { return [ diff --git a/TestFoundation/TestUtils.swift b/TestFoundation/TestUtils.swift index 860e1291d9..b2c28f9a70 100644 --- a/TestFoundation/TestUtils.swift +++ b/TestFoundation/TestUtils.swift @@ -7,14 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - func ensureFiles(_ fileNames: [String]) -> Bool { var result = true let fm = FileManager.default diff --git a/TestFoundation/TestXMLDocument.swift b/TestFoundation/TestXMLDocument.swift index ee62114e71..56ed296343 100644 --- a/TestFoundation/TestXMLDocument.swift +++ b/TestFoundation/TestXMLDocument.swift @@ -7,16 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - - class TestXMLDocument : LoopbackServerTest { static var allTests: [(String, (TestXMLDocument) -> () throws -> Void)] { diff --git a/TestFoundation/TestXMLParser.swift b/TestFoundation/TestXMLParser.swift index 36ac9cc882..24a3281b56 100644 --- a/TestFoundation/TestXMLParser.swift +++ b/TestFoundation/TestXMLParser.swift @@ -7,15 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // - -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) - import Foundation - import XCTest -#else - import SwiftFoundation - import SwiftXCTest -#endif - enum XMLParserDelegateEvent { case startDocument case endDocument diff --git a/TestFoundation/XDGTestHelper.swift b/TestFoundation/XDGTestHelper.swift index 15099abc9d..219f3a06c5 100644 --- a/TestFoundation/XDGTestHelper.swift +++ b/TestFoundation/XDGTestHelper.swift @@ -7,12 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if os(Linux) - import Foundation -#else - import SwiftFoundation -#endif - class XDGCheck { static func run() -> Never { diff --git a/TestFoundation/main.swift b/TestFoundation/main.swift index c2c3c0a660..403ac6a659 100644 --- a/TestFoundation/main.swift +++ b/TestFoundation/main.swift @@ -7,21 +7,14 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if DEPLOYMENT_RUNTIME_OBJC || os(Linux) -import Foundation -import XCTest -#else -import SwiftFoundation -import SwiftXCTest -#endif +// Most imports now centraized in TestImports.swift #if os(macOS) || os(iOS) import Darwin -#elseif os(Linux) +#elseif os(Linux) || os(Android) import Glibc #endif - // ignore SIGPIPE which is sent when writing to closed file descriptors. _ = signal(SIGPIPE, SIG_IGN) diff --git a/TestFoundation/xdgTestHelper/main.swift b/TestFoundation/xdgTestHelper/main.swift index 19b12fda60..0bc1506116 100644 --- a/TestFoundation/xdgTestHelper/main.swift +++ b/TestFoundation/xdgTestHelper/main.swift @@ -7,12 +7,6 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // -#if os(Linux) - import Foundation -#else - import SwiftFoundation -#endif - enum HelperCheckStatus : Int32 { case ok = 0 case fail = 1 From 3f4fbe5e2a3a54a23c06a2095bb007b0b8d9b70b Mon Sep 17 00:00:00 2001 From: John Holdsworth Date: Fri, 20 Apr 2018 20:34:15 +0100 Subject: [PATCH 2/2] Leave imports in xdgTestHelper.swift --- TestFoundation/HTTPServer.swift | 4 ++-- TestFoundation/XDGTestHelper.swift | 6 ++++++ TestFoundation/main.swift | 4 ++-- TestFoundation/xdgTestHelper/main.swift | 6 ++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/TestFoundation/HTTPServer.swift b/TestFoundation/HTTPServer.swift index 34a1f882a2..00a22304c9 100644 --- a/TestFoundation/HTTPServer.swift +++ b/TestFoundation/HTTPServer.swift @@ -14,9 +14,9 @@ import Dispatch -#if os(macOS) || os(iOS) +#if canImport(Darwin) import Darwin -#elseif os(Linux) +#elseif canImport(Glibc) import Glibc #endif diff --git a/TestFoundation/XDGTestHelper.swift b/TestFoundation/XDGTestHelper.swift index 219f3a06c5..566489bff3 100644 --- a/TestFoundation/XDGTestHelper.swift +++ b/TestFoundation/XDGTestHelper.swift @@ -7,6 +7,12 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // +#if os(Linux) || os(Android) + import Foundation +#else + import SwiftFoundation +#endif + class XDGCheck { static func run() -> Never { diff --git a/TestFoundation/main.swift b/TestFoundation/main.swift index 403ac6a659..4afe1b54a6 100644 --- a/TestFoundation/main.swift +++ b/TestFoundation/main.swift @@ -9,9 +9,9 @@ // Most imports now centraized in TestImports.swift -#if os(macOS) || os(iOS) +#if canImport(Darwin) import Darwin -#elseif os(Linux) || os(Android) +#elseif canImport(Glibc) import Glibc #endif diff --git a/TestFoundation/xdgTestHelper/main.swift b/TestFoundation/xdgTestHelper/main.swift index 0bc1506116..c883b2843e 100644 --- a/TestFoundation/xdgTestHelper/main.swift +++ b/TestFoundation/xdgTestHelper/main.swift @@ -7,6 +7,12 @@ // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // +#if os(Linux) || os(Android) + import Foundation +#else + import SwiftFoundation +#endif + enum HelperCheckStatus : Int32 { case ok = 0 case fail = 1