mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
tests: add import statements to workaround linker errors in all relevant tests.
This is needed if we compile StdlibUnittest with -sil-serialize-all So far I added the imports only in files which needed them. But this may change, depending on the optimizer (inlining). Adding them in all files doesn't harm and avoids confusion if someone makes an unrelated change which would result in such a linker error.
This commit is contained in:
@@ -5,6 +5,14 @@
|
||||
import Foundation
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
let BoolTests = TestSuite("Bool")
|
||||
|
||||
BoolTests.test("Init with NSNumber") {
|
||||
|
||||
@@ -21,6 +21,14 @@ import Swift
|
||||
import SwiftShims
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
#if _runtime(_ObjC)
|
||||
import Foundation
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
//
|
||||
// Check that CollectionType.SubSequence is constrained to CollectionType.
|
||||
//
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
|
||||
var DarwinBooleanAPI = TestSuite("DarwinBooleanAPI")
|
||||
|
||||
@@ -18,6 +18,14 @@ import SwiftExperimental
|
||||
import Foundation
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
// Check that the generic parameters are called 'Key' and 'Value'.
|
||||
protocol TestProtocol1 {}
|
||||
|
||||
|
||||
@@ -7,6 +7,14 @@ import Dispatch
|
||||
import Foundation
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
defer { runAllTests() }
|
||||
|
||||
var DispatchAPI = TestSuite("DispatchAPI")
|
||||
|
||||
@@ -3,6 +3,15 @@
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
import CoreLocation
|
||||
import Darwin
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
// XFAIL: linux
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
|
||||
// Check that `NonObjectiveCBase` can be subclassed and the subclass can be
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
|
||||
var NSArrayAPI = TestSuite("NSArrayAPI")
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
|
||||
var tests = TestSuite("NSDictionary")
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
|
||||
var NSEnumeratorAPI = TestSuite("NSEnumeratorAPI")
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
|
||||
var NSSetAPI = TestSuite("NSSetAPI")
|
||||
|
||||
@@ -11,6 +11,15 @@
|
||||
//
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
import StdlibUnittestFoundationExtras
|
||||
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
|
||||
var nsValueBridging = TestSuite("NSValueBridging")
|
||||
|
||||
@@ -8,6 +8,15 @@
|
||||
|
||||
import Swift
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
import CoreGraphics
|
||||
import SwiftShims
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
// UNSUPPORTED: OS=watchos
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import SceneKit
|
||||
|
||||
// SceneKit is only available on iOS 8.0 and above and on OS X 10.8 and above.
|
||||
|
||||
@@ -15,6 +15,14 @@
|
||||
import Swift
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
var UnicodeInternals = TestSuite("UnicodeInternals")
|
||||
|
||||
UnicodeInternals.test("copy") {
|
||||
|
||||
@@ -20,6 +20,14 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import FakeUnavailableObjCFramework
|
||||
import Foundation
|
||||
|
||||
|
||||
@@ -11,6 +11,15 @@
|
||||
// RUN: %target-run %t/main
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import resilient_class
|
||||
import resilient_struct
|
||||
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
enum ClericalErrorDomain: ErrorType {
|
||||
case MisplacedDocument(name: String)
|
||||
case AccidentallyErasedTape(fromMinute: Double, toMinute: Double)
|
||||
|
||||
@@ -10,6 +10,15 @@
|
||||
// RUN: %target-run %t/main
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import resilient_enum
|
||||
import resilient_struct
|
||||
|
||||
|
||||
@@ -7,6 +7,15 @@
|
||||
// RUN: %target-run %t/main
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import resilient_global
|
||||
import resilient_struct
|
||||
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
// RUN: %target-run %t/main
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import resilient_struct
|
||||
|
||||
var ResilientStructTestSuite = TestSuite("ResilientStruct")
|
||||
|
||||
@@ -1304,6 +1304,14 @@ public func transform<C : CollectionType>(c: C)
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
var t = TestSuite("t")
|
||||
|
||||
t.test("fusion/map+reduce") {
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
// UNSUPPORTED: OS=watchos
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import CoreMedia
|
||||
|
||||
var CoreMediaTests = TestSuite("CoreMedia")
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
// UNSUPPORTED: OS=watchos
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import CoreMedia
|
||||
|
||||
var CMTimeTests = TestSuite("CMTime")
|
||||
|
||||
@@ -12,6 +12,15 @@
|
||||
|
||||
import Darwin
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
import StdlibUnittestFoundationExtras
|
||||
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
// UNSUPPORTED: OS=watchos
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import GameplayKit
|
||||
|
||||
// GameplayKit is only available on iOS 9.0 and above, OS X 10.11 and above, and
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
|
||||
import Swift
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Glibc
|
||||
|
||||
var GlibcTestSuite = TestSuite("Glibc")
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
import ObjectiveC
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
var ObjectiveCTests = TestSuite("ObjectiveC")
|
||||
|
||||
class NSObjectWithCustomHashable : NSObject {
|
||||
|
||||
@@ -54,6 +54,15 @@
|
||||
|
||||
import OpenCL
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
import Darwin
|
||||
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
// UNSUPPORTED: OS=watchos
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import SceneKit
|
||||
|
||||
// SceneKit is only available on iOS 8.0 and above and on OS X 10.8 and above.
|
||||
|
||||
@@ -11,6 +11,15 @@
|
||||
// XFAIL: linux
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
|
||||
// For experimental Set operators
|
||||
|
||||
@@ -9,6 +9,14 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
var TestSuiteFails = TestSuite("TestSuiteFails")
|
||||
|
||||
TestSuiteFails.test("fails") {
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
//
|
||||
// Test OS version parsing
|
||||
//
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
struct S1 {}
|
||||
struct S2 {}
|
||||
|
||||
|
||||
@@ -6,6 +6,15 @@
|
||||
|
||||
import SwiftPrivate
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
|
||||
var UTF16APIs = TestSuite("UTF16APIs")
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
|
||||
import SwiftPrivate
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import Foundation
|
||||
|
||||
@_silgen_name("random") func random() -> UInt32
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
// REQUIRES: OS=watchos
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import WatchKit
|
||||
|
||||
var WatchKitTests = TestSuite("WatchKit")
|
||||
|
||||
@@ -11,6 +11,15 @@
|
||||
// XFAIL: OS=watchos
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This
|
||||
// workaround is needed to link all required libraries in case we compile
|
||||
// StdlibUnittest with -sil-serialize-all.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
import XCTest
|
||||
|
||||
var XCTestTestSuite = TestSuite("XCTest")
|
||||
|
||||
Reference in New Issue
Block a user