stdlib tests: add import statements to prevent unresolved symbols when compiling StdlibUnittest with -sil-serialize-all.

rdar://problem/18917405
This commit is contained in:
Erik Eckstein
2015-11-19 15:13:45 -08:00
parent 5e7342633b
commit 308f39fe56
18 changed files with 132 additions and 0 deletions

View File

@@ -12,6 +12,13 @@
import StdlibUnittest 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 # We test for bounds-checking traps for both reading and writing
# both single elements and slices of all three different array # both single elements and slices of all three different array

View File

@@ -9,6 +9,14 @@
import StdlibUnittest 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") var CharacterTraps = TestSuite("CharacterTraps")
CharacterTraps.test("CharacterFromEmptyString") CharacterTraps.test("CharacterFromEmptyString")

View File

@@ -13,6 +13,13 @@
import StdlibUnittest import StdlibUnittest
import Foundation 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 { struct NotBridgedKeyTy : Equatable, Hashable {
init(_ value: Int) { init(_ value: Int) {
self.value = value self.value = value

View File

@@ -6,6 +6,13 @@
import StdlibUnittest 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") var DictionaryUnchecked = TestSuite("DictionaryUnchecked")
DictionaryUnchecked.test("noCseOnInit") { DictionaryUnchecked.test("noCseOnInit") {

View File

@@ -18,6 +18,13 @@
import StdlibUnittest 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 { struct DistanceToTest {
let startIndex: Int let startIndex: Int
let endIndex: Int let endIndex: Int

View File

@@ -20,6 +20,13 @@
import StdlibUnittest 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") var IntervalTraps = TestSuite("IntervalTraps")
IntervalTraps.test("HalfOpen") IntervalTraps.test("HalfOpen")

View File

@@ -11,6 +11,13 @@
import StdlibUnittest 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? { func returnNil() -> AnyObject? {
return _opaqueIdentity(nil as AnyObject?) return _opaqueIdentity(nil as AnyObject?)
} }

View File

@@ -20,6 +20,13 @@
import StdlibUnittest 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") var RangeTraps = TestSuite("RangeTraps")
RangeTraps.test("HalfOpen") RangeTraps.test("HalfOpen")

View File

@@ -13,6 +13,13 @@
import StdlibUnittest import StdlibUnittest
import Foundation 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 { struct NotBridgedKeyTy : Equatable, Hashable {
init(_ value: Int) { init(_ value: Int) {
self.value = value self.value = value

View File

@@ -12,6 +12,13 @@
import StdlibUnittest import StdlibUnittest
import Foundation 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") var StringTraps = TestSuite("StringTraps")
StringTraps.test("startIndex/predecessor") StringTraps.test("startIndex/predecessor")

View File

@@ -8,6 +8,13 @@
import Darwin import Darwin
import StdlibUnittest 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") var TGMathTestSuite = TestSuite("tgmath")
let minusOneDouble = Double(-1.0) let minusOneDouble = Double(-1.0)

View File

@@ -14,6 +14,14 @@ import StdlibUnittest
import Foundation import Foundation
import SlurpFastEnumeration 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 { struct ArrayBridge_objectAtIndex_RaceTest : RaceTestWithPerTrialDataType {
class RaceData { class RaceData {
var nsa: NSArray var nsa: NSArray

View File

@@ -11,6 +11,15 @@
import StdlibUnittest 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. // Tests.
//===--- //===---

View File

@@ -8,6 +8,14 @@
import SwiftPrivate import SwiftPrivate
import StdlibUnittest 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 { final class HeapBool {
var value: Bool var value: Bool
init(_ value: Bool) { init(_ value: Bool) {

View File

@@ -13,6 +13,14 @@ import StdlibUnittest
import Foundation import Foundation
import SlurpFastEnumeration 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 { struct DictionaryBridge_objectForKey_RaceTest : RaceTestWithPerTrialDataType {
class RaceData { class RaceData {
var nsd: NSDictionary var nsd: NSDictionary

View File

@@ -10,6 +10,13 @@
import StdlibUnittest 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 // 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 // constants. This is to to check runtime behaviour and ensure the constant is
// not folded. // not folded.

View File

@@ -10,6 +10,13 @@
import StdlibUnittest 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 * from SwiftIntTypes import *

View File

@@ -5,6 +5,13 @@
import SwiftPrivate import SwiftPrivate
import StdlibUnittest 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") var HashingTestSuite = TestSuite("Hashing")
func avalancheTest(bits: Int, _ hashUnderTest: (UInt64) -> UInt64, _ pValue: Double) { func avalancheTest(bits: Int, _ hashUnderTest: (UInt64) -> UInt64, _ pValue: Double) {