Skip to content

Commit 6a2c8bd

Browse files
Merge pull request swiftlang#18593 from aschwaighofer/codesign_reflection_tests
Codesign reflection tests
2 parents b9a53eb + b05f0b4 commit 6a2c8bd

33 files changed

+47
-1
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,6 +2209,21 @@ function(add_swift_target_executable name)
22092209
${SWIFTEXE_TARGET_EXCLUDE_FROM_ALL_FLAG_CURRENT}
22102210
${SWIFTEXE_TARGET_DONT_STRIP_NON_MAIN_SYMBOLS_FLAG}
22112211
${SWIFTEXE_DISABLE_ASLR_FLAG})
2212+
2213+
is_darwin_based_sdk("${sdk}" IS_DARWIN)
2214+
if(IS_DARWIN)
2215+
add_custom_command_target(unused_var2
2216+
COMMAND "codesign" "-f" "-s" "-" "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}"
2217+
CUSTOM_TARGET_NAME "${VARIANT_NAME}_signed"
2218+
OUTPUT "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}_signed"
2219+
DEPENDS ${VARIANT_NAME})
2220+
else()
2221+
# No code signing on other platforms.
2222+
add_custom_command_target(unused_var2
2223+
CUSTOM_TARGET_NAME "${VARIANT_NAME}_signed"
2224+
OUTPUT "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}_signed"
2225+
DEPENDS ${VARIANT_NAME})
2226+
endif()
22122227
endforeach()
22132228
endforeach()
22142229
endfunction()

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ foreach(SDK ${SWIFT_SDKS})
196196

197197
if(SWIFT_BUILD_STDLIB AND SWIFT_INCLUDE_TESTS)
198198
list(APPEND test_dependencies
199-
"swift-reflection-test${VARIANT_SUFFIX}")
199+
"swift-reflection-test${VARIANT_SUFFIX}_signed")
200200
endif()
201201

202202
if(NOT "${COVERAGE_DB}" STREQUAL "")

validation-test/Reflection/existentials.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/existentials
3+
// RUN: %target-codesign %t/existentials
34
// RUN: %target-run %target-swift-reflection-test %t/existentials | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
45
// REQUIRES: objc_interop
56
// REQUIRES: executable_test

validation-test/Reflection/functions.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/functions
3+
// RUN: %target-codesign %t/functions
34
// RUN: %target-run %target-swift-reflection-test %t/functions | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
45

56
// FIXME: Should not require objc_interop -- please put Objective-C-specific

validation-test/Reflection/functions_objc.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/functions
3+
// RUN: %target-codesign %t/functions
34
// RUN: %target-run %target-swift-reflection-test %t/functions | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
45
// REQUIRES: objc_interop
56
// REQUIRES: executable_test

validation-test/Reflection/inherits_NSObject.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/inherits_NSObject
3+
// RUN: %target-codesign %t/inherits_NSObject
34
// RUN: %target-run %target-swift-reflection-test %t/inherits_NSObject | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
45

56
// REQUIRES: objc_interop

validation-test/Reflection/inherits_ObjCClasses.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// RUN: %clang %target-cc-options -isysroot %sdk -fobjc-arc %S/Inputs/ObjCClasses/ObjCClasses.m -c -o %t/ObjCClasses.o
44
// RUN: %target-build-swift -I %S/Inputs/ObjCClasses/ -lswiftSwiftReflectionTest %t/ObjCClasses.o %s -o %t/inherits_ObjCClasses
5+
// RUN: %target-codesign %t/inherits_ObjCClasses
56
// RUN: %target-run %target-swift-reflection-test %t/inherits_ObjCClasses | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
67

78
// REQUIRES: objc_interop

validation-test/Reflection/inherits_Swift.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/inherits_Swift
3+
// RUN: %target-codesign %t/inherits_Swift
34
// RUN: %target-run %target-swift-reflection-test %t/inherits_Swift | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
45

56
// REQUIRES: objc_interop

validation-test/Reflection/reflect_Array.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Array
3+
// RUN: %target-codesign %t/reflect_Array
34
// RUN: %target-run %target-swift-reflection-test %t/reflect_Array 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
45
// REQUIRES: objc_interop
56
// REQUIRES: executable_test

validation-test/Reflection/reflect_Bool.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Bool
3+
// RUN: %target-codesign %t/reflect_Bool
34
// RUN: %target-run %target-swift-reflection-test %t/reflect_Bool 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
45
// REQUIRES: objc_interop
56
// REQUIRES: executable_test

0 commit comments

Comments
 (0)