From 8b9cf8ac14ce9f408f9ecc9f0275bbba2a78f1a7 Mon Sep 17 00:00:00 2001 From: Jonathan Grynspan Date: Sun, 28 Apr 2024 13:40:52 -0400 Subject: [PATCH] Revert "Stop using the `SWIFT_PM_SUPPORTS_SWIFT_TESTING` flag. (#376)" This reverts commit f40b57a608af459c813503782565e7abe3def8b5. --- Sources/Testing/Running/XCTestScaffold.swift | 6 +++--- Tests/TestingMacrosTests/TestSupport/Scaffolding.swift | 2 +- Tests/TestingTests/ExitTestTests.swift | 2 +- Tests/TestingTests/TestSupport/Scaffolding.swift | 2 +- Tests/TestingTests/Traits/TagListTests.swift | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/Testing/Running/XCTestScaffold.swift b/Sources/Testing/Running/XCTestScaffold.swift index a0aa530e1..4642a5a52 100644 --- a/Sources/Testing/Running/XCTestScaffold.swift +++ b/Sources/Testing/Running/XCTestScaffold.swift @@ -76,7 +76,7 @@ extension XCTIssue { /// ## See Also /// /// - -#if compiler(>=5.11) +#if SWIFT_PM_SUPPORTS_SWIFT_TESTING @available(*, deprecated, message: "This version of Swift Package Manager supports running swift-testing tests directly. This type will be removed in a future release.") #else @available(swift, deprecated: 100000.0, message: "This type is provided temporarily to aid in integrating the testing library with existing tools such as Swift Package Manager. It will be removed in a future release.") @@ -109,13 +109,13 @@ public enum XCTestScaffold: Sendable { /// ## See Also /// /// - -#if compiler(>=5.11) +#if SWIFT_PM_SUPPORTS_SWIFT_TESTING @available(*, deprecated, message: "This version of Swift Package Manager supports running swift-testing tests directly. This function has no effect and will be removed in a future release.") #else @available(swift, deprecated: 100000.0, message: "This function is provided temporarily to aid in integrating the testing library with existing tools such as Swift Package Manager. It will be removed in a future release.") #endif public static func runAllTests(hostedBy testCase: XCTestCase, _ functionName: String = #function) async { -#if compiler(>=5.11) +#if SWIFT_PM_SUPPORTS_SWIFT_TESTING let message = Event.ConsoleOutputRecorder.warning( "This version of Swift Package Manager supports running swift-testing tests directly. Ignoring call to \(#function).", options: .for(.stderr) diff --git a/Tests/TestingMacrosTests/TestSupport/Scaffolding.swift b/Tests/TestingMacrosTests/TestSupport/Scaffolding.swift index db52afdf2..766a7d614 100644 --- a/Tests/TestingMacrosTests/TestSupport/Scaffolding.swift +++ b/Tests/TestingMacrosTests/TestSupport/Scaffolding.swift @@ -8,7 +8,7 @@ // See https://swift.org/CONTRIBUTORS.txt for Swift project authors // -#if !SWT_NO_XCTEST_SCAFFOLDING && compiler(<5.11) && canImport(XCTest) +#if !SWT_NO_XCTEST_SCAFFOLDING && !SWIFT_PM_SUPPORTS_SWIFT_TESTING && canImport(XCTest) import XCTest import Testing diff --git a/Tests/TestingTests/ExitTestTests.swift b/Tests/TestingTests/ExitTestTests.swift index 6cb2ad369..0b4bc945b 100644 --- a/Tests/TestingTests/ExitTestTests.swift +++ b/Tests/TestingTests/ExitTestTests.swift @@ -44,7 +44,7 @@ private import TestingInternals #endif } -#if compiler(>=5.11) +#if SWIFT_PM_SUPPORTS_SWIFT_TESTING @Test("Exit tests (failing)") func failing() async { let expectedCount: Int #if os(Windows) diff --git a/Tests/TestingTests/TestSupport/Scaffolding.swift b/Tests/TestingTests/TestSupport/Scaffolding.swift index db52afdf2..766a7d614 100644 --- a/Tests/TestingTests/TestSupport/Scaffolding.swift +++ b/Tests/TestingTests/TestSupport/Scaffolding.swift @@ -8,7 +8,7 @@ // See https://swift.org/CONTRIBUTORS.txt for Swift project authors // -#if !SWT_NO_XCTEST_SCAFFOLDING && compiler(<5.11) && canImport(XCTest) +#if !SWT_NO_XCTEST_SCAFFOLDING && !SWIFT_PM_SUPPORTS_SWIFT_TESTING && canImport(XCTest) import XCTest import Testing diff --git a/Tests/TestingTests/Traits/TagListTests.swift b/Tests/TestingTests/Traits/TagListTests.swift index 1d364d097..6debcefd8 100644 --- a/Tests/TestingTests/Traits/TagListTests.swift +++ b/Tests/TestingTests/Traits/TagListTests.swift @@ -222,7 +222,7 @@ struct TagListTests { #expect(Tag.Color.rgb(0, 0, 0) < .rgb(100, 100, 100)) } -#if !SWT_NO_EXIT_TESTS && compiler(>=5.11) && !canImport(SwiftSyntax600) +#if !SWT_NO_EXIT_TESTS && SWIFT_PM_SUPPORTS_SWIFT_TESTING && !canImport(SwiftSyntax600) @Test("Invalid symbolic tag declaration") func invalidSymbolicTag() async { await #expect(exitsWith: .failure) {