Skip to content

Commit 89f97a2

Browse files
authored
Merge pull request #11780 from slavapestov/fix-resilience-tests-in-simulator
Get resilience tests working on iOS again
2 parents 6a2b603 + f61c241 commit 89f97a2

File tree

7 files changed

+31
-16
lines changed

7 files changed

+31
-16
lines changed

test/Interpreter/class_resilience.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_struct.swift -emit-module-path %t/resilient_struct.swiftmodule -module-name resilient_struct -emit-library -o %t/libresilient_struct.%target-dylib-extension
44
// RUN: %target-build-swift -emit-module-path %t/resilient_class.swiftmodule -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_class.swift -I %t/ -L %t/ -lresilient_struct -module-name resilient_class -emit-library -o %t/libresilient_class.%target-dylib-extension
55
// RUN: %target-build-swift %s -lresilient_struct -lresilient_class -I %t -L %t -o %t/main -Xlinker -rpath -Xlinker %t
6+
// RUN: %target-codesign %t/libresilient_struct.%target-dylib-extension
7+
// RUN: %target-codesign %t/libresilient_class.%target-dylib-extension
68
// RUN: %target-run %t/main
79

810
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_struct.swift -emit-module-path %t/resilient_struct.swiftmodule -module-name resilient_struct -emit-library -o %t/libresilient_struct.%target-dylib-extension -whole-module-optimization
911
// RUN: %target-build-swift -emit-module-path %t/resilient_class.swiftmodule -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_class.swift -I %t/ -L %t/ -lresilient_struct -module-name resilient_class -emit-library -o %t/libresilient_class.%target-dylib-extension -whole-module-optimization
1012
// RUN: %target-build-swift %s -lresilient_struct -lresilient_class -I %t -L %t -o %t/main -Xlinker -rpath -Xlinker %t
13+
// RUN: %target-codesign %t/libresilient_struct.%target-dylib-extension
14+
// RUN: %target-codesign %t/libresilient_class.%target-dylib-extension
1115
// RUN: %target-run %t/main
1216

1317
// REQUIRES: executable_test
1418

15-
// <rdar://problem/34148403>
16-
// REQUIRES: OS=macosx
17-
1819
import StdlibUnittest
1920

2021

test/Interpreter/enum_resilience.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_struct.swift -emit-module-path %t/resilient_struct.swiftmodule -module-name resilient_struct -emit-library -o %t/libresilient_struct.%target-dylib-extension
44
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_enum.swift -emit-module-path %t/resilient_enum.swiftmodule -module-name resilient_enum -emit-library -o %t/libresilient_enum.%target-dylib-extension -I %t -L %t -lresilient_struct
55
// RUN: %target-build-swift %s -L %t -I %t -lresilient_struct -lresilient_enum -o %t/main -Xlinker -rpath -Xlinker %t
6+
// RUN: %target-codesign %t/libresilient_struct.%target-dylib-extension
7+
// RUN: %target-codesign %t/libresilient_enum.%target-dylib-extension
68
// RUN: %target-run %t/main
79

810
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_struct.swift -emit-module-path %t/resilient_struct.swiftmodule -module-name resilient_struct -emit-library -o %t/libresilient_struct.%target-dylib-extension -whole-module-optimization
911
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_enum.swift -emit-module-path %t/resilient_enum.swiftmodule -module-name resilient_enum -emit-library -o %t/libresilient_enum.%target-dylib-extension -I %t -L %t -lresilient_struct -whole-module-optimization
1012
// RUN: %target-build-swift %s -L %t -I %t -lresilient_struct -lresilient_enum -o %t/main -Xlinker -rpath -Xlinker %t
13+
// RUN: %target-codesign %t/libresilient_struct.%target-dylib-extension
14+
// RUN: %target-codesign %t/libresilient_enum.%target-dylib-extension
1115
// RUN: %target-run %t/main
1216

1317
// REQUIRES: executable_test
1418

15-
// <rdar://problem/34148403>
16-
// REQUIRES: OS=macosx
17-
1819
import StdlibUnittest
1920

2021

test/Interpreter/global_resilience.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_struct.swift -emit-module-path %t/resilient_struct.swiftmodule -module-name resilient_struct -emit-library -o %t/libresilient_struct.%target-dylib-extension
44
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_global.swift -emit-module-path %t/resilient_global.swiftmodule -module-name resilient_global -emit-library -o %t/libresilient_global.%target-dylib-extension
55
// RUN: %target-build-swift %s -lresilient_global -lresilient_struct -I %t -L %t -o %t/main -Xlinker -rpath -Xlinker %t
6+
// RUN: %target-codesign %t/libresilient_struct.%target-dylib-extension
7+
// RUN: %target-codesign %t/libresilient_global.%target-dylib-extension
68
// RUN: %target-run %t/main
79

810
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_struct.swift -emit-module-path %t/resilient_struct.swiftmodule -module-name resilient_struct -emit-library -o %t/libresilient_struct.%target-dylib-extension -whole-module-optimization
911
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_global.swift -emit-module-path %t/resilient_global.swiftmodule -module-name resilient_global -emit-library -o %t/libresilient_global.%target-dylib-extension -whole-module-optimization
1012
// RUN: %target-build-swift %s -lresilient_global -lresilient_struct -I %t -L %t -o %t/main -Xlinker -rpath -Xlinker %t
13+
// RUN: %target-codesign %t/libresilient_struct.%target-dylib-extension
14+
// RUN: %target-codesign %t/libresilient_global.%target-dylib-extension
1115
// RUN: %target-run %t/main
1216

1317
// REQUIRES: executable_test
1418

15-
// <rdar://problem/34148403>
16-
// REQUIRES: OS=macosx
17-
1819
import StdlibUnittest
1920

2021

test/Interpreter/objc_runtime_visible.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22

33
// RUN: %clang %target-cc-options -isysroot %sdk -fobjc-arc %S/Inputs/objc_runtime_visible.m -fmodules -nodefaultlibs -lc -dynamiclib -o %t/libobjc_runtime_visible.dylib -install_name @executable_path/libobjc_runtime_visible.dylib
4-
// RUN: codesign -f -s - %t/libobjc_runtime_visible.dylib
4+
// RUN: %target-codesign %t/libobjc_runtime_visible.dylib
55
// RUN: nm -g %t/libobjc_runtime_visible.dylib | %FileCheck %s
66
// RUN: %target-build-swift -import-objc-header %S/Inputs/objc_runtime_visible.h %t/libobjc_runtime_visible.dylib %s -o %t/main
77
// RUN: %target-run %t/main %t/libobjc_runtime_visible.dylib

test/Interpreter/protocol_resilience.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-build-swift -emit-library -Xfrontend -enable-resilience -c %S/../Inputs/resilient_protocol.swift -o %t/resilient_protocol.o
3-
// RUN: %target-build-swift -emit-module -Xfrontend -enable-resilience -c %S/../Inputs/resilient_protocol.swift -o %t/resilient_protocol.o
4-
// RUN: %target-build-swift %s -Xlinker %t/resilient_protocol.o -I %t -L %t -o %t/main
2+
3+
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_protocol.swift -emit-module-path %t/resilient_protocol.swiftmodule -module-name resilient_protocol -emit-library -o %t/libresilient_protocol.%target-dylib-extension
4+
// RUN: %target-build-swift %s -lresilient_protocol -I %t -L %t -o %t/main -Xlinker -rpath -Xlinker %t
5+
// RUN: %target-codesign %t/libresilient_protocol.%target-dylib-extension
6+
// RUN: %target-run %t/main
7+
8+
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_protocol.swift -emit-module-path %t/resilient_protocol.swiftmodule -module-name resilient_protocol -emit-library -o %t/libresilient_protocol.%target-dylib-extension -whole-module-optimization
9+
// RUN: %target-build-swift %s -lresilient_protocol -I %t -L %t -o %t/main -Xlinker -rpath -Xlinker %t
10+
// RUN: %target-codesign %t/libresilient_protocol.%target-dylib-extension
511
// RUN: %target-run %t/main
12+
613
// REQUIRES: executable_test
714

815
//

test/Interpreter/struct_resilience.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_struct.swift -emit-module-path %t/resilient_struct.swiftmodule -module-name resilient_struct -emit-library -o %t/libresilient_struct.%target-dylib-extension
44
// RUN: %target-build-swift %s -lresilient_struct -I %t -L %t -o %t/main -Xlinker -rpath -Xlinker %t
5+
// RUN: %target-codesign %t/libresilient_struct.%target-dylib-extension
56
// RUN: %target-run %t/main
67

78
// RUN: %target-build-swift -emit-module -parse-as-library -Xfrontend -enable-resilience %S/../Inputs/resilient_struct.swift -emit-module-path %t/resilient_struct.swiftmodule -module-name resilient_struct -emit-library -o %t/libresilient_struct.%target-dylib-extension -whole-module-optimization
89
// RUN: %target-build-swift %s -lresilient_struct -I %t -L %t -o %t/main -Xlinker -rpath -Xlinker %t
10+
// RUN: %target-codesign %t/libresilient_struct.%target-dylib-extension
911
// RUN: %target-run %t/main
1012

1113
// REQUIRES: executable_test
1214

13-
// <rdar://problem/34148403>
14-
// REQUIRES: OS=macosx
15-
1615
import StdlibUnittest
1716

1817

test/lit.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ if run_vendor == 'apple':
544544
config.target_swiftdoc_name = run_cpu + ".swiftdoc"
545545
config.target_object_format = "macho"
546546
config.target_dylib_extension = "dylib"
547+
config.target_codesign = "codesign -f -s -"
547548
config.target_runtime = "objc"
548549

549550
xcrun_prefix = (
@@ -721,6 +722,8 @@ if run_vendor == 'apple':
721722
(xcrun_prefix, config.target_cc_options))
722723

723724
elif run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'windows-cygnus', 'windows-gnu']:
725+
config.target_codesign = "echo"
726+
724727
# Linux/FreeBSD/Cygwin
725728
if run_os == 'windows-cygnus':
726729
lit_config.note("Testing Cygwin " + config.variant_triple)
@@ -799,6 +802,7 @@ elif run_os == 'linux-androideabi':
799802
config.target_dylib_extension = "so"
800803
config.target_runtime = "native"
801804
config.target_swift_autolink_extract = inferSwiftBinary("swift-autolink-extract")
805+
config.target_codesign = "echo"
802806
config.target_sdk_name = "android"
803807
android_linker_opt = "-L {libcxx} -L {libgcc}".format(
804808
libcxx=os.path.join(config.android_ndk_path,
@@ -1052,6 +1056,8 @@ config.substitutions.append(('%target-swiftdoc-name', config.target_swiftdoc_nam
10521056
config.substitutions.append(('%target-object-format', config.target_object_format))
10531057
config.substitutions.append(('%target-dylib-extension', config.target_dylib_extension))
10541058

1059+
config.substitutions.append(('%target-codesign', config.target_codesign))
1060+
10551061
config.substitutions.append(('%target-resilience-test-wmo', config.target_resilience_test_wmo))
10561062
config.substitutions.append(('%target-resilience-test', config.target_resilience_test))
10571063

0 commit comments

Comments
 (0)