-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathswift-android-testing-except-release.patch
48 lines (48 loc) · 2.64 KB
/
swift-android-testing-except-release.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
diff --git a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
index 468dc61..a90ae3d 100644
--- a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
+++ b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
@@ -2,6 +2,10 @@
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info)
if(CMAKE_Swift_COMPILER_TARGET)
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET})
+else()
+ set(arg_list ${CMAKE_Swift_FLAGS})
+ separate_arguments(arg_list)
+ list(APPEND print_target_info_invocation ${arg_list})
endif()
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"
diff --git a/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift b/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
index 78227e3..e0db2e9 100644
--- a/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
+++ b/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
@@ -65,11 +65,11 @@ public struct Backtrace: Sendable {
} else {
initializedCount = .init(clamping: backtrace(addresses.baseAddress!, .init(clamping: addresses.count)))
}
-#elseif os(Android)
+#elseif os(Androi)
initializedCount = addresses.withMemoryRebound(to: UnsafeMutableRawPointer.self) { addresses in
.init(clamping: backtrace(addresses.baseAddress!, .init(clamping: addresses.count)))
}
-#elseif os(Linux) || os(FreeBSD) || os(OpenBSD)
+#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(Android)
initializedCount = .init(clamping: backtrace(addresses.baseAddress!, .init(clamping: addresses.count)))
#elseif os(Windows)
initializedCount = Int(clamping: RtlCaptureStackBackTrace(0, ULONG(clamping: addresses.count), addresses.baseAddress!, nil))
diff --git a/swift-testing/cmake/modules/PlatformInfo.cmake b/swift-testing/cmake/modules/PlatformInfo.cmake
index 94c60ef..ab8a491 100644
--- a/swift-testing/cmake/modules/PlatformInfo.cmake
+++ b/swift-testing/cmake/modules/PlatformInfo.cmake
@@ -9,6 +9,10 @@
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info)
if(CMAKE_Swift_COMPILER_TARGET)
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET})
+else()
+ set(arg_list ${CMAKE_Swift_FLAGS})
+ separate_arguments(arg_list)
+ list(APPEND print_target_info_invocation ${arg_list})
endif()
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"