File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
6
6
project (XCTest LANGUAGES Swift )
7
7
8
8
option (BUILD_SHARED_LIBS "Build shared libraries" ON )
9
+ option (USE_FOUNDATION_FRAMEWORK "Use Foundation.framework on Darwin" NO )
9
10
10
11
if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
11
12
find_package (dispatch CONFIG REQUIRED )
@@ -46,6 +47,10 @@ add_library(XCTest
46
47
Sources /XCTest/Public/Asynchronous/XCTWaiter.swift
47
48
Sources /XCTest/Public/Asynchronous/XCTestCase+Asynchronous.swift
48
49
Sources /XCTest/Public/Asynchronous/XCTestExpectation.swift )
50
+ if (USE_FOUNDATION_FRAMEWORK )
51
+ target_compile_definitions (XCTest PRIVATE
52
+ USE_FOUNDATION_FRAMEWORK )
53
+ endif ()
49
54
if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin )
50
55
target_link_libraries (XCTest PRIVATE
51
56
dispatch
Original file line number Diff line number Diff line change 15
15
// Note that we are re-exporting Foundation so tests importing XCTest don't need
16
16
// to import it themselves. This is consistent with the behavior of Apple XCTest
17
17
#if os(macOS)
18
+ #if USE_FOUNDATION_FRAMEWORK
19
+ @_exported import Foundation
20
+ #else
18
21
@_exported import SwiftFoundation
22
+ #endif
19
23
#else
20
24
@_exported import Foundation
21
25
#endif
@@ -92,7 +96,7 @@ public func XCTMain(_ testCases: [XCTestCaseEntry]) -> Never {
92
96
let errMsg = " Error: Invalid option \" \( invalid) \" \n "
93
97
FileHandle . standardError. write ( errMsg. data ( using: . utf8) ?? Data ( ) )
94
98
}
95
- let exeName = CommandLine . arguments [ 0 ] . lastPathComponent
99
+ let exeName = URL ( fileURLWithPath : CommandLine . arguments [ 0 ] ) . lastPathComponent
96
100
let sampleTest = rootTestSuite. list ( ) . first ?? " Tests.FooTestCase/testFoo "
97
101
let sampleTests = sampleTest. prefix ( while: { $0 != " / " } )
98
102
print ( """
You can’t perform that action at this time.
0 commit comments