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)
66project (XCTest LANGUAGES Swift)
77
88option (BUILD_SHARED_LIBS "Build shared libraries" ON )
9+ option (USE_FOUNDATION_FRAMEWORK "Use Foundation.framework on Darwin" NO )
910
1011if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
1112 find_package (dispatch CONFIG REQUIRED)
@@ -46,6 +47,10 @@ add_library(XCTest
4647 Sources /XCTest/Public /Asynchronous/XCTWaiter.swift
4748 Sources /XCTest/Public /Asynchronous/XCTestCase+Asynchronous.swift
4849 Sources /XCTest/Public /Asynchronous/XCTestExpectation.swift)
50+ if (USE_FOUNDATION_FRAMEWORK)
51+ target_compile_definitions (XCTest PRIVATE
52+ USE_FOUNDATION_FRAMEWORK)
53+ endif ()
4954if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
5055 target_link_libraries (XCTest PRIVATE
5156 dispatch
Original file line number Diff line number Diff line change 1515// Note that we are re-exporting Foundation so tests importing XCTest don't need
1616// to import it themselves. This is consistent with the behavior of Apple XCTest
1717#if os(macOS)
18+ #if USE_FOUNDATION_FRAMEWORK
19+ @_exported import Foundation
20+ #else
1821 @_exported import SwiftFoundation
22+ #endif
1923#else
2024 @_exported import Foundation
2125#endif
@@ -92,7 +96,7 @@ public func XCTMain(_ testCases: [XCTestCaseEntry]) -> Never {
9296 let errMsg = " Error: Invalid option \" \( invalid) \" \n "
9397 FileHandle . standardError. write ( errMsg. data ( using: . utf8) ?? Data ( ) )
9498 }
95- let exeName = CommandLine . arguments [ 0 ] . lastPathComponent
99+ let exeName = URL ( fileURLWithPath : CommandLine . arguments [ 0 ] ) . lastPathComponent
96100 let sampleTest = rootTestSuite. list ( ) . first ?? " Tests.FooTestCase/testFoo "
97101 let sampleTests = sampleTest. prefix ( while: { $0 != " / " } )
98102 print ( """
You can’t perform that action at this time.
0 commit comments