File tree Expand file tree Collapse file tree 4 files changed +6
-2
lines changed
Sources/Testing/EntryPoints
TestingTests/_Testing_Foundation Expand file tree Collapse file tree 4 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -376,7 +376,7 @@ private func _eventHandlerForStreamingEvents_v0(toFileAtPath path: String) throw
376
376
byte == 10 || byte == 13
377
377
}
378
378
379
- #if DEBUG
379
+ #if DEBUG && !SWT_NO_FILE_IO
380
380
// We don't actually expect the JSON encoder to produce output containing
381
381
// newline characters, so in debug builds we'll log a diagnostic message.
382
382
if eventAndContextJSON. contains ( where: isASCIINewline) {
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ public enum XCTestScaffold: Sendable {
116
116
#endif
117
117
public static func runAllTests( hostedBy testCase: XCTestCase , _ functionName: String = #function) async {
118
118
#if SWIFT_PM_SUPPORTS_SWIFT_TESTING
119
+ #if !SWT_NO_FILE_IO
119
120
let message = Event . ConsoleOutputRecorder. warning (
120
121
" This version of Swift Package Manager supports running swift-testing tests directly. Ignoring call to \( #function) . " ,
121
122
options: . for( . stderr)
@@ -125,6 +126,7 @@ public enum XCTestScaffold: Sendable {
125
126
#else
126
127
print ( message)
127
128
#endif
129
+ #endif
128
130
#else
129
131
let testCase = UncheckedSendable ( rawValue: testCase)
130
132
#if SWT_TARGET_OS_APPLE
Original file line number Diff line number Diff line change @@ -331,6 +331,7 @@ struct ConditionMacroTests {
331
331
#expect( diagnostics. isEmpty)
332
332
}
333
333
334
+ #if !SWT_NO_EXIT_TESTS
334
335
@Test ( " Expectation inside an exit test diagnoses " ,
335
336
arguments: [
336
337
" #expectExitTest(exitsWith: .failure) { #expect(1 > 2) } " ,
@@ -344,6 +345,7 @@ struct ConditionMacroTests {
344
345
#expect( diagnostic. message. contains ( " record an issue " ) )
345
346
#expect( diagnostic. message. contains ( " (exitsWith: " ) )
346
347
}
348
+ #endif
347
349
348
350
@Test ( " Macro expansion is performed within a test function " )
349
351
func macroExpansionInTestFunction( ) throws {
Original file line number Diff line number Diff line change 8
8
// See https://swift.org/CONTRIBUTORS.txt for Swift project authors
9
9
//
10
10
11
- #if canImport(Foundation)
11
+ #if canImport(Foundation) && !SWT_NO_UTC_CLOCK
12
12
@testable @_spi ( Experimental) @_spi ( ForToolsIntegrationOnly) import _Testing_Foundation
13
13
@_spi ( Experimental) @_spi ( ForToolsIntegrationOnly) import Testing
14
14
import Foundation
You can’t perform that action at this time.
0 commit comments