Skip to content

Commit 308f39f

Browse files
committed
stdlib tests: add import statements to prevent unresolved symbols when compiling StdlibUnittest with -sil-serialize-all.
rdar://problem/18917405
1 parent 5e73426 commit 308f39f

18 files changed

+132
-0
lines changed

test/1_stdlib/ArrayTraps.swift.gyb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212

1313
import StdlibUnittest
1414

15+
// Also import modules which are used by StdlibUnittest internally. This is
16+
// needed to link all required libraries in case we serialize StdlibUnittest.
17+
import SwiftPrivate
18+
#if _runtime(_ObjC)
19+
import ObjectiveC
20+
#endif
21+
1522
%{
1623
# We test for bounds-checking traps for both reading and writing
1724
# both single elements and slices of all three different array

test/1_stdlib/CharacterTraps.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99

1010
import StdlibUnittest
1111

12+
// Also import modules which are used by StdlibUnittest internally. This is
13+
// needed to link all required libraries in case we serialize StdlibUnittest.
14+
import SwiftPrivate
15+
#if _runtime(_ObjC)
16+
import ObjectiveC
17+
#endif
18+
19+
1220
var CharacterTraps = TestSuite("CharacterTraps")
1321

1422
CharacterTraps.test("CharacterFromEmptyString")

test/1_stdlib/DictionaryTraps.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
import StdlibUnittest
1414
import Foundation
1515

16+
// Also import modules which are used by StdlibUnittest internally. This is
17+
// needed to link all required libraries in case we serialize StdlibUnittest.
18+
import SwiftPrivate
19+
#if _runtime(_ObjC)
20+
import ObjectiveC
21+
#endif
22+
1623
struct NotBridgedKeyTy : Equatable, Hashable {
1724
init(_ value: Int) {
1825
self.value = value

test/1_stdlib/DictionaryUnchecked.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77
import StdlibUnittest
88

9+
// Also import modules which are used by StdlibUnittest internally. This is
10+
// needed to link all required libraries in case we serialize StdlibUnittest.
11+
import SwiftPrivate
12+
#if _runtime(_ObjC)
13+
import ObjectiveC
14+
#endif
15+
916
var DictionaryUnchecked = TestSuite("DictionaryUnchecked")
1017

1118
DictionaryUnchecked.test("noCseOnInit") {

test/1_stdlib/Index.swift.gyb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818

1919
import StdlibUnittest
2020

21+
// Also import modules which are used by StdlibUnittest internally. This is
22+
// needed to link all required libraries in case we serialize StdlibUnittest.
23+
import SwiftPrivate
24+
#if _runtime(_ObjC)
25+
import ObjectiveC
26+
#endif
27+
2128
struct DistanceToTest {
2229
let startIndex: Int
2330
let endIndex: Int

test/1_stdlib/IntervalTraps.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020

2121
import StdlibUnittest
2222

23+
// Also import modules which are used by StdlibUnittest internally. This is
24+
// needed to link all required libraries in case we serialize StdlibUnittest.
25+
import SwiftPrivate
26+
#if _runtime(_ObjC)
27+
import ObjectiveC
28+
#endif
29+
2330
var IntervalTraps = TestSuite("IntervalTraps")
2431

2532
IntervalTraps.test("HalfOpen")

test/1_stdlib/OptionalTraps.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111

1212
import StdlibUnittest
1313

14+
// Also import modules which are used by StdlibUnittest internally. This is
15+
// needed to link all required libraries in case we serialize StdlibUnittest.
16+
import SwiftPrivate
17+
#if _runtime(_ObjC)
18+
import ObjectiveC
19+
#endif
20+
1421
func returnNil() -> AnyObject? {
1522
return _opaqueIdentity(nil as AnyObject?)
1623
}

test/1_stdlib/RangeTraps.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020

2121
import StdlibUnittest
2222

23+
// Also import modules which are used by StdlibUnittest internally. This is
24+
// needed to link all required libraries in case we serialize StdlibUnittest.
25+
import SwiftPrivate
26+
#if _runtime(_ObjC)
27+
import ObjectiveC
28+
#endif
29+
2330
var RangeTraps = TestSuite("RangeTraps")
2431

2532
RangeTraps.test("HalfOpen")

test/1_stdlib/SetTraps.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
import StdlibUnittest
1414
import Foundation
1515

16+
// Also import modules which are used by StdlibUnittest internally. This is
17+
// needed to link all required libraries in case we serialize StdlibUnittest.
18+
import SwiftPrivate
19+
#if _runtime(_ObjC)
20+
import ObjectiveC
21+
#endif
22+
1623
struct NotBridgedKeyTy : Equatable, Hashable {
1724
init(_ value: Int) {
1825
self.value = value

test/1_stdlib/StringTraps.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
import StdlibUnittest
1313
import Foundation
1414

15+
// Also import modules which are used by StdlibUnittest internally. This is
16+
// needed to link all required libraries in case we serialize StdlibUnittest.
17+
import SwiftPrivate
18+
#if _runtime(_ObjC)
19+
import ObjectiveC
20+
#endif
21+
1522
var StringTraps = TestSuite("StringTraps")
1623

1724
StringTraps.test("startIndex/predecessor")

0 commit comments

Comments
 (0)