|
12 | 12 | // RUN: rm -rf %t
|
13 | 13 | // RUN: mkdir -p %t
|
14 | 14 | //
|
15 |
| -// RUN: %target-clang %S/Inputs/Mirror/Mirror.mm -c -o %t/Mirror.mm.o -g |
16 |
| -// RUN: %target-build-swift %s -I %S/Inputs/Mirror/ -Xlinker %t/Mirror.mm.o -o %t/Mirror |
| 15 | +// RUN: if [ %target-runtime == "objc" ]; \ |
| 16 | +// RUN: then \ |
| 17 | +// RUN: %target-clang %S/Inputs/Mirror/Mirror.mm -c -o %t/Mirror.mm.o -g && \ |
| 18 | +// RUN: %target-build-swift %s -I %S/Inputs/Mirror/ -Xlinker %t/Mirror.mm.o -o %t/Mirror; \ |
| 19 | +// RUN: else \ |
| 20 | +// RUN: %target-build-swift %s -o %t/Mirror; \ |
| 21 | +// RUN: fi |
17 | 22 | // RUN: %target-run %t/Mirror
|
18 | 23 | // REQUIRES: executable_test
|
19 | 24 |
|
20 |
| -// XFAIL: linux |
21 |
| - |
22 | 25 | import StdlibUnittest
|
23 | 26 |
|
24 | 27 |
|
@@ -354,6 +357,7 @@ mirrors.test("class/CustomizedSuper/Synthesized") {
|
354 | 357 | }
|
355 | 358 | }
|
356 | 359 |
|
| 360 | +#if _runtime(_ObjC) |
357 | 361 | import Foundation
|
358 | 362 |
|
359 | 363 | //===--- ObjC Base Classes ------------------------------------------------===//
|
@@ -461,6 +465,7 @@ mirrors.test("class/ObjCCustomizedSuper/Synthesized") {
|
461 | 465 | }
|
462 | 466 | }
|
463 | 467 | }
|
| 468 | +#endif // _runtime(_ObjC) |
464 | 469 |
|
465 | 470 | //===--- Suppressed Superclass Mirrors ------------------------------------===//
|
466 | 471 | mirrors.test("Class/Root/NoSuperclassMirror") {
|
@@ -717,7 +722,10 @@ mirrors.test("PlaygroundQuickLook") {
|
717 | 722 | struct X {}
|
718 | 723 | switch PlaygroundQuickLook(reflecting: X()) {
|
719 | 724 | case .text(let text):
|
| 725 | +#if _runtime(_ObjC) |
| 726 | +// FIXME: Enable if non-objc hasSuffix is implemented. |
720 | 727 | expectTrue(text.hasSuffix(".(X #1)()"), text)
|
| 728 | +#endif |
721 | 729 | default:
|
722 | 730 | expectTrue(false)
|
723 | 731 | }
|
@@ -759,13 +767,15 @@ mirrors.test("_DefaultCustomPlaygroundQuickLookable") {
|
759 | 767 | }
|
760 | 768 | }
|
761 | 769 |
|
| 770 | +#if _runtime(_ObjC) |
762 | 771 | import MirrorObjC
|
763 | 772 | mirrors.test("ObjC") {
|
764 | 773 | // Some Foundation classes lie about their ivars, which would crash
|
765 | 774 | // a mirror; make sure we are not automatically exposing ivars of
|
766 | 775 | // Objective-C classes from the default mirror implementation.
|
767 | 776 | expectEqual(0, Mirror(reflecting: HasIVars()).children.count)
|
768 | 777 | }
|
| 778 | +#endif |
769 | 779 |
|
770 | 780 | mirrors.test("String.init") {
|
771 | 781 | expectEqual("42", String(42))
|
|
0 commit comments