From eabc7d46e868de11997c5f80b71ea3ac369197ac Mon Sep 17 00:00:00 2001 From: Jonathan Grynspan Date: Thu, 25 Sep 2025 15:09:43 -0400 Subject: [PATCH] Mark exit tests unavailable in Embedded Swift. For the moment at least, we don't support exit tests in Embedded Swift. We can investigate supporting them in the future. --- Sources/Testing/ExitTests/ExitTest.CapturedValue.swift | 1 + Sources/Testing/ExitTests/ExitTest.Condition.swift | 4 ++++ Sources/Testing/ExitTests/ExitTest.Result.swift | 1 + Sources/Testing/ExitTests/ExitTest.swift | 1 + Sources/Testing/Expectations/Expectation+Macro.swift | 2 ++ 5 files changed, 9 insertions(+) diff --git a/Sources/Testing/ExitTests/ExitTest.CapturedValue.swift b/Sources/Testing/ExitTests/ExitTest.CapturedValue.swift index c311978a8..556fc0cf6 100644 --- a/Sources/Testing/ExitTests/ExitTest.CapturedValue.swift +++ b/Sources/Testing/ExitTests/ExitTest.CapturedValue.swift @@ -12,6 +12,7 @@ private import _TestingInternals @_spi(ForToolsIntegrationOnly) #if SWT_NO_EXIT_TESTS +@_unavailableInEmbedded @available(*, unavailable, message: "Exit tests are not available on this platform.") #endif extension ExitTest { diff --git a/Sources/Testing/ExitTests/ExitTest.Condition.swift b/Sources/Testing/ExitTests/ExitTest.Condition.swift index fd3f3680c..edd94193b 100644 --- a/Sources/Testing/ExitTests/ExitTest.Condition.swift +++ b/Sources/Testing/ExitTests/ExitTest.Condition.swift @@ -11,6 +11,7 @@ private import _TestingInternals #if SWT_NO_EXIT_TESTS +@_unavailableInEmbedded @available(*, unavailable, message: "Exit tests are not available on this platform.") #endif extension ExitTest { @@ -58,6 +59,7 @@ extension ExitTest { // MARK: - #if SWT_NO_EXIT_TESTS +@_unavailableInEmbedded @available(*, unavailable, message: "Exit tests are not available on this platform.") #endif extension ExitTest.Condition { @@ -177,6 +179,7 @@ extension ExitTest.Condition { // MARK: - CustomStringConvertible #if SWT_NO_EXIT_TESTS +@_unavailableInEmbedded @available(*, unavailable, message: "Exit tests are not available on this platform.") #endif extension ExitTest.Condition: CustomStringConvertible { @@ -199,6 +202,7 @@ extension ExitTest.Condition: CustomStringConvertible { // MARK: - Comparison #if SWT_NO_EXIT_TESTS +@_unavailableInEmbedded @available(*, unavailable, message: "Exit tests are not available on this platform.") #endif extension ExitTest.Condition { diff --git a/Sources/Testing/ExitTests/ExitTest.Result.swift b/Sources/Testing/ExitTests/ExitTest.Result.swift index e31afa937..53d816c85 100644 --- a/Sources/Testing/ExitTests/ExitTest.Result.swift +++ b/Sources/Testing/ExitTests/ExitTest.Result.swift @@ -9,6 +9,7 @@ // #if SWT_NO_EXIT_TESTS +@_unavailableInEmbedded @available(*, unavailable, message: "Exit tests are not available on this platform.") #endif extension ExitTest { diff --git a/Sources/Testing/ExitTests/ExitTest.swift b/Sources/Testing/ExitTests/ExitTest.swift index cec43a6ce..56096906f 100644 --- a/Sources/Testing/ExitTests/ExitTest.swift +++ b/Sources/Testing/ExitTests/ExitTest.swift @@ -35,6 +35,7 @@ private import _TestingInternals /// @Available(Xcode, introduced: 26.0) /// } #if SWT_NO_EXIT_TESTS +@_unavailableInEmbedded @available(*, unavailable, message: "Exit tests are not available on this platform.") #endif public struct ExitTest: Sendable, ~Copyable { diff --git a/Sources/Testing/Expectations/Expectation+Macro.swift b/Sources/Testing/Expectations/Expectation+Macro.swift index 17127d058..ea007f667 100644 --- a/Sources/Testing/Expectations/Expectation+Macro.swift +++ b/Sources/Testing/Expectations/Expectation+Macro.swift @@ -877,6 +877,7 @@ public macro require( @freestanding(expression) @discardableResult #if SWT_NO_EXIT_TESTS +@_unavailableInEmbedded @available(*, unavailable, message: "Exit tests are not available on this platform.") #endif public macro expect( @@ -924,6 +925,7 @@ public macro expect( @freestanding(expression) @discardableResult #if SWT_NO_EXIT_TESTS +@_unavailableInEmbedded @available(*, unavailable, message: "Exit tests are not available on this platform.") #endif public macro require(