From c111da333084f818c44145d941cfcf3dd5c1e36b Mon Sep 17 00:00:00 2001 From: Jonathan Grynspan Date: Wed, 11 Sep 2024 14:08:06 -0400 Subject: [PATCH 1/2] [6.0.0] Remove `@MainActor` from XCTest glue. --- Sources/Build/LLBuildCommands.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Sources/Build/LLBuildCommands.swift b/Sources/Build/LLBuildCommands.swift index f083947608b..153043b3b1a 100644 --- a/Sources/Build/LLBuildCommands.swift +++ b/Sources/Build/LLBuildCommands.swift @@ -76,7 +76,6 @@ final class TestDiscoveryCommand: CustomLLBuildCommand, TestBuildCommand { fileprivate extension \#(className) { @available(*, deprecated, message: "Not actually deprecated. Marked as deprecated to allow inclusion of deprecated tests (which test deprecated functionality) without warnings") - @MainActor static let __allTests__\#(className) = [ \#(testMethods.map(\.allTestsEntry).joined(separator: ",\n ")) ] @@ -88,13 +87,12 @@ final class TestDiscoveryCommand: CustomLLBuildCommand, TestBuildCommand { content += #""" @available(*, deprecated, message: "Not actually deprecated. Marked as deprecated to allow inclusion of deprecated tests (which test deprecated functionality) without warnings") - @MainActor func __\#(module)__allTests() -> [XCTestCaseEntry] { return [ \#( testsByClassNames.map { "testCase(\($0.key).__allTests__\($0.key))" } .joined(separator: ",\n ") - ) + ) ] } """# @@ -163,7 +161,6 @@ final class TestDiscoveryCommand: CustomLLBuildCommand, TestBuildCommand { import XCTest @available(*, deprecated, message: "Not actually deprecated. Marked as deprecated to allow inclusion of deprecated tests (which test deprecated functionality) without warnings") - @MainActor public func __allDiscoveredTests() -> [XCTestCaseEntry] { \#(testsKeyword) tests = [XCTestCaseEntry]() From e1d1364230c99d813b859d57795cf6c38af93ac3 Mon Sep 17 00:00:00 2001 From: Jonathan Grynspan Date: Thu, 12 Sep 2024 13:59:02 -0400 Subject: [PATCH 2/2] Make __allTests__ nonisolated --- Sources/Build/LLBuildCommands.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Build/LLBuildCommands.swift b/Sources/Build/LLBuildCommands.swift index 153043b3b1a..34bcbadb643 100644 --- a/Sources/Build/LLBuildCommands.swift +++ b/Sources/Build/LLBuildCommands.swift @@ -76,7 +76,7 @@ final class TestDiscoveryCommand: CustomLLBuildCommand, TestBuildCommand { fileprivate extension \#(className) { @available(*, deprecated, message: "Not actually deprecated. Marked as deprecated to allow inclusion of deprecated tests (which test deprecated functionality) without warnings") - static let __allTests__\#(className) = [ + static nonisolated(unsafe) let __allTests__\#(className) = [ \#(testMethods.map(\.allTestsEntry).joined(separator: ",\n ")) ] }