Skip to content

Commit 8c1a1dc

Browse files
authored
Merge pull request #24921 from mikeash/existentials-objc-test-disable-testing-os-libraries
[Test] Disable existentials_objc.swift when testing against OS libraries.
2 parents 528fe42 + d15a651 commit 8c1a1dc

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed
Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/existentials_objc
33
// RUN: %target-codesign %t/existentials_objc
4-
// RUN: %target-run %target-swift-reflection-test %t/existentials_objc | %FileCheck %s
4+
// RUN: %target-run %target-swift-reflection-test %t/existentials_objc > %t.txt
5+
// RUN: grep SkipTheTest %t.txt || %FileCheck %s < %t.txt
56

67
// REQUIRES: objc_interop
78
// REQUIRES: executable_test
@@ -15,15 +16,21 @@ import Foundation
1516

1617
import SwiftReflectionTest
1718

18-
// Imported class wrapped in AnyObject
19-
20-
// CHECK: Type reference:
21-
// CHECK: (objective_c_class name=NSObject)
22-
reflect(object: NSObject())
23-
24-
// Tagged pointer wrapped in AnyObject
25-
// CHECK: Type reference:
26-
// CHECK: (objective_c_class name=__NSCFNumber)
27-
reflect(object: NSNumber(123))
19+
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
20+
// Imported class wrapped in AnyObject
21+
22+
// CHECK: Type reference:
23+
// CHECK: (objective_c_class name=NSObject)
24+
reflect(object: NSObject())
25+
26+
// Tagged pointer wrapped in AnyObject
27+
// CHECK: Type reference:
28+
// CHECK: (objective_c_class name=__NSCFNumber)
29+
reflect(object: NSNumber(123))
30+
} else {
31+
// The Swift 5.0 libraries don't support this test.
32+
class SkipTheTest {}
33+
reflect(object: SkipTheTest())
34+
}
2835

2936
doneReflecting()

0 commit comments

Comments
 (0)