mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
stdlib tests: add import statements to prevent unresolved symbols when compiling StdlibUnittest with -sil-serialize-all.
rdar://problem/18917405
This commit is contained in:
@@ -12,6 +12,13 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
%{
|
||||
# We test for bounds-checking traps for both reading and writing
|
||||
# both single elements and slices of all three different array
|
||||
|
||||
@@ -9,6 +9,14 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
|
||||
var CharacterTraps = TestSuite("CharacterTraps")
|
||||
|
||||
CharacterTraps.test("CharacterFromEmptyString")
|
||||
|
||||
@@ -13,6 +13,13 @@
|
||||
import StdlibUnittest
|
||||
import Foundation
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
struct NotBridgedKeyTy : Equatable, Hashable {
|
||||
init(_ value: Int) {
|
||||
self.value = value
|
||||
|
||||
@@ -6,6 +6,13 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
var DictionaryUnchecked = TestSuite("DictionaryUnchecked")
|
||||
|
||||
DictionaryUnchecked.test("noCseOnInit") {
|
||||
|
||||
@@ -18,6 +18,13 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
struct DistanceToTest {
|
||||
let startIndex: Int
|
||||
let endIndex: Int
|
||||
|
||||
@@ -20,6 +20,13 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
var IntervalTraps = TestSuite("IntervalTraps")
|
||||
|
||||
IntervalTraps.test("HalfOpen")
|
||||
|
||||
@@ -11,6 +11,13 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
func returnNil() -> AnyObject? {
|
||||
return _opaqueIdentity(nil as AnyObject?)
|
||||
}
|
||||
|
||||
@@ -20,6 +20,13 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
var RangeTraps = TestSuite("RangeTraps")
|
||||
|
||||
RangeTraps.test("HalfOpen")
|
||||
|
||||
@@ -13,6 +13,13 @@
|
||||
import StdlibUnittest
|
||||
import Foundation
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
struct NotBridgedKeyTy : Equatable, Hashable {
|
||||
init(_ value: Int) {
|
||||
self.value = value
|
||||
|
||||
@@ -12,6 +12,13 @@
|
||||
import StdlibUnittest
|
||||
import Foundation
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
var StringTraps = TestSuite("StringTraps")
|
||||
|
||||
StringTraps.test("startIndex/predecessor")
|
||||
|
||||
@@ -8,6 +8,13 @@
|
||||
import Darwin
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
var TGMathTestSuite = TestSuite("tgmath")
|
||||
|
||||
let minusOneDouble = Double(-1.0)
|
||||
|
||||
@@ -14,6 +14,14 @@ import StdlibUnittest
|
||||
import Foundation
|
||||
import SlurpFastEnumeration
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
import SwiftPrivatePthreadExtras
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
struct ArrayBridge_objectAtIndex_RaceTest : RaceTestWithPerTrialDataType {
|
||||
class RaceData {
|
||||
var nsa: NSArray
|
||||
|
||||
@@ -11,6 +11,15 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
import SwiftPrivatePthreadExtras
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
|
||||
//===---
|
||||
// Tests.
|
||||
//===---
|
||||
|
||||
@@ -8,6 +8,14 @@
|
||||
import SwiftPrivate
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
import SwiftPrivatePthreadExtras
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
final class HeapBool {
|
||||
var value: Bool
|
||||
init(_ value: Bool) {
|
||||
|
||||
@@ -13,6 +13,14 @@ import StdlibUnittest
|
||||
import Foundation
|
||||
import SlurpFastEnumeration
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
import SwiftPrivatePthreadExtras
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
struct DictionaryBridge_objectForKey_RaceTest : RaceTestWithPerTrialDataType {
|
||||
class RaceData {
|
||||
var nsd: NSDictionary
|
||||
|
||||
@@ -10,6 +10,13 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
// Note: in this file, we need to go through opaque functions to load
|
||||
// constants. This is to to check runtime behaviour and ensure the constant is
|
||||
// not folded.
|
||||
|
||||
@@ -10,6 +10,13 @@
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
%{
|
||||
|
||||
from SwiftIntTypes import *
|
||||
|
||||
@@ -5,6 +5,13 @@
|
||||
import SwiftPrivate
|
||||
import StdlibUnittest
|
||||
|
||||
// Also import modules which are used by StdlibUnittest internally. This is
|
||||
// needed to link all required libraries in case we serialize StdlibUnittest.
|
||||
import SwiftPrivate
|
||||
#if _runtime(_ObjC)
|
||||
import ObjectiveC
|
||||
#endif
|
||||
|
||||
var HashingTestSuite = TestSuite("Hashing")
|
||||
|
||||
func avalancheTest(bits: Int, _ hashUnderTest: (UInt64) -> UInt64, _ pValue: Double) {
|
||||
|
||||
Reference in New Issue
Block a user