Skip to content

Codesign reflection tests #18593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2209,6 +2209,21 @@ function(add_swift_target_executable name)
${SWIFTEXE_TARGET_EXCLUDE_FROM_ALL_FLAG_CURRENT}
${SWIFTEXE_TARGET_DONT_STRIP_NON_MAIN_SYMBOLS_FLAG}
${SWIFTEXE_DISABLE_ASLR_FLAG})

is_darwin_based_sdk("${sdk}" IS_DARWIN)
if(IS_DARWIN)
add_custom_command_target(unused_var2
COMMAND "codesign" "-f" "-s" "-" "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}"
CUSTOM_TARGET_NAME "${VARIANT_NAME}_signed"
OUTPUT "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}_signed"
DEPENDS ${VARIANT_NAME})
else()
# No code signing on other platforms.
add_custom_command_target(unused_var2
CUSTOM_TARGET_NAME "${VARIANT_NAME}_signed"
OUTPUT "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}_signed"
DEPENDS ${VARIANT_NAME})
endif()
endforeach()
endforeach()
endfunction()
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ foreach(SDK ${SWIFT_SDKS})

if(SWIFT_BUILD_STDLIB AND SWIFT_INCLUDE_TESTS)
list(APPEND test_dependencies
"swift-reflection-test${VARIANT_SUFFIX}")
"swift-reflection-test${VARIANT_SUFFIX}_signed")
endif()

if(NOT "${COVERAGE_DB}" STREQUAL "")
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/existentials.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/existentials
// RUN: %target-codesign %t/existentials
// RUN: %target-run %target-swift-reflection-test %t/existentials | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/functions.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/functions
// RUN: %target-codesign %t/functions
// RUN: %target-run %target-swift-reflection-test %t/functions | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize

// FIXME: Should not require objc_interop -- please put Objective-C-specific
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/functions_objc.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/functions
// RUN: %target-codesign %t/functions
// RUN: %target-run %target-swift-reflection-test %t/functions | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/inherits_NSObject.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/inherits_NSObject
// RUN: %target-codesign %t/inherits_NSObject
// RUN: %target-run %target-swift-reflection-test %t/inherits_NSObject | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize

// REQUIRES: objc_interop
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/inherits_ObjCClasses.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

// REQUIRES: objc_interop
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/inherits_Swift.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/inherits_Swift
// RUN: %target-codesign %t/inherits_Swift
// RUN: %target-run %target-swift-reflection-test %t/inherits_Swift | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize

// REQUIRES: objc_interop
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_Array.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Array
// RUN: %target-codesign %t/reflect_Array
// RUN: %target-run %target-swift-reflection-test %t/reflect_Array 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_Bool.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Bool
// RUN: %target-codesign %t/reflect_Bool
// RUN: %target-run %target-swift-reflection-test %t/reflect_Bool 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_Character.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Character
// RUN: %target-codesign %t/reflect_Character
// RUN: %target-run %target-swift-reflection-test %t/reflect_Character 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_Dictionary.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Dictionary
// RUN: %target-codesign %t/reflect_Dictionary
// RUN: %target-run %target-swift-reflection-test %t/reflect_Dictionary 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_Double.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Double
// RUN: %target-codesign %t/reflect_Double
// RUN: %target-run %target-swift-reflection-test %t/reflect_Double 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_Float.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Float
// RUN: %target-codesign %t/reflect_Float
// RUN: %target-run %target-swift-reflection-test %t/reflect_Float 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_Int.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Int
// RUN: %target-codesign %t/reflect_Int
// RUN: %target-run %target-swift-reflection-test %t/reflect_Int 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_Int16.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Int16
// RUN: %target-codesign %t/reflect_Int16
// RUN: %target-run %target-swift-reflection-test %t/reflect_Int16 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_Int32.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Int32
// RUN: %target-codesign %t/reflect_Int32
// RUN: %target-run %target-swift-reflection-test %t/reflect_Int32 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_Int64.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Int64
// RUN: %target-codesign %t/reflect_Int64
// RUN: %target-run %target-swift-reflection-test %t/reflect_Int64 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_Int8.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Int8
// RUN: %target-codesign %t/reflect_Int8
// RUN: %target-run %target-swift-reflection-test %t/reflect_Int8 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_NSArray.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_NSArray
// RUN: %target-codesign %t/reflect_NSArray
// RUN: %target-run %target-swift-reflection-test %t/reflect_NSArray 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_NSNumber.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_NSNumber
// RUN: %target-codesign %t/reflect_NSNumber
// RUN: %target-run %target-swift-reflection-test %t/reflect_NSNumber 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_NSSet.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_NSSet
// RUN: %target-codesign %t/reflect_NSSet
// RUN: %target-run %target-swift-reflection-test %t/reflect_NSSet 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_NSString.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_NSString
// RUN: %target-codesign %t/reflect_NSString
// RUN: %target-run %target-swift-reflection-test %t/reflect_NSString 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_Set.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_Set
// RUN: %target-codesign %t/reflect_Set
// RUN: %target-run %target-swift-reflection-test %t/reflect_Set 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_String.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_String
// RUN: %target-codesign %t/reflect_String
// RUN: %target-run %target-swift-reflection-test %t/reflect_String 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_UInt.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_UInt
// RUN: %target-codesign %t/reflect_UInt
// RUN: %target-run %target-swift-reflection-test %t/reflect_UInt 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_UInt16.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_UInt16
// RUN: %target-codesign %t/reflect_UInt16
// RUN: %target-run %target-swift-reflection-test %t/reflect_UInt16 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_UInt32.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_UInt32
// RUN: %target-codesign %t/reflect_UInt32
// RUN: %target-run %target-swift-reflection-test %t/reflect_UInt32 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_UInt64.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_UInt64
// RUN: %target-codesign %t/reflect_UInt64
// RUN: %target-run %target-swift-reflection-test %t/reflect_UInt64 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_UInt8.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_UInt8
// RUN: %target-codesign %t/reflect_UInt8
// RUN: %target-run %target-swift-reflection-test %t/reflect_UInt8 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_empty_class.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_empty_class
// RUN: %target-codesign %t/reflect_empty_class
// RUN: %target-run %target-swift-reflection-test %t/reflect_empty_class 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_existential.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_existential
// RUN: %target-codesign %t/reflect_existential
// RUN: %target-run %target-swift-reflection-test %t/reflect_existential 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down
1 change: 1 addition & 0 deletions validation-test/Reflection/reflect_multiple_types.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -lswiftSwiftReflectionTest %s -o %t/reflect_multiple_types
// RUN: %target-codesign %t/reflect_multiple_types
// RUN: %target-run %target-swift-reflection-test %t/reflect_multiple_types 2>&1 | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_interop
// REQUIRES: executable_test
Expand Down