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
|
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
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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") {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
@@ -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?)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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.
|
||||||
//===---
|
//===---
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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 *
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user