diff --git a/Development/ColorTests/ColorTests.swift b/Development/ColorTests/ColorTests.swift index 2d3a0eb..ff9250a 100644 --- a/Development/ColorTests/ColorTests.swift +++ b/Development/ColorTests/ColorTests.swift @@ -10,29 +10,24 @@ // Xcode/CI and the in-app test UI execute identical checks. #if compiler(>=5.9) && canImport(Color) && canImport(Testing) import Color -import Compatibility +import CompatibilityTesting import Testing -/// Bridges each ordered Color test section into Swift Testing without duplicating the behavioral assertions. +/// Presents every reusable Color `TestCase` as its own named Swift Testing argument. @Suite("Color Tests") struct ColorTestsSuite { - /// Runs one reusable test while retaining its section name in Swift Testing's argument report. + /// Runs the same ordered reusable tests used by Compatibility's in-app test UI. @Test( "Reusable Color test", .serialized, arguments: await MainActor.run { - ColorKit.tests.flatMap { section, tests in - tests.map { (section: section, test: $0) } - } + ModuleTestEntry.entries(for: ColorKit.self, tests: ColorKit.tests) } ) @MainActor @available(iOS 13, macOS 12, tvOS 13, watchOS 6, *) - func reusableColorTest(section: String, test: TestCase) async throws { - // Execute the shared closure directly so thrown failures retain Swift - // Testing's native context while the section argument identifies its group. - _ = section - try await test.execute() + func reusableColorTest(_ entry: ModuleTestEntry) async throws { + try await entry.execute() } } #endif diff --git a/Package.swift b/Package.swift index 2672c0f..5fc0310 100644 --- a/Package.swift +++ b/Package.swift @@ -137,6 +137,7 @@ targets += [ name: "\(packageLibraryName)Tests", dependencies: [ .init(stringLiteral: packageLibraryName), // Use the shared name while preserving the manifest pattern required by Playgrounds. + .product(name: "Compatibility Testing Library", package: "compatibility"), ], path: "Development/ColorTests" ), @@ -150,7 +151,7 @@ let package = Package( // include dependencies dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/kudit/Compatibility.git", from: "1.18.0"), + .package(url: "https://github.com/kudit/Compatibility.git", from: "1.19.0"), ], targets: targets )