Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions Development/ParticleEffectsTests/ParticleEffectsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,28 @@
// Swift Testing requires Swift 5.9 or newer. These guards also keep alternate toolchains from trying to
// compile an unavailable test framework or module while the manifest's separate guard protects Playgrounds.
#if compiler(>=5.9) && canImport(ParticleEffects) && canImport(Testing)
import Compatibility
import CompatibilityTesting
import ParticleEffects
import Testing

/// Bridges ParticleEffects' ordered reusable tests into Swift Testing.
/// Presents every reusable ParticleEffects `TestCase` as its own named Swift Testing argument.
///
/// Animation timing and SwiftUI layout remain excluded because wall-clock and view-hosting checks would be
/// fragile across the package's supported platforms. The deterministic checks live on ``ParticleEffects/tests``.
@Suite("ParticleEffects Tests")
struct ParticleEffectsTests {
/// Runs one shared 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 ParticleEffects test",
.serialized,
arguments: await MainActor.run {
ParticleEffects.tests.flatMap { section, tests in
tests.map { (section: section, test: $0) }
}
ModuleTestEntry.entries(for: ParticleEffects.self, tests: ParticleEffects.tests)
}
)
@MainActor
@available(iOS 13, macOS 12, tvOS 13, watchOS 6, *)
func reusableParticleEffectsTest(section: String, test: TestCase) async throws {
// The section is intentionally retained as an argument so failures are grouped in deterministic context.
_ = section
// Execute the shared closure directly so thrown failures remain native Swift Testing failures.
try await test.execute()
func reusableParticleEffectsTest(_ entry: ModuleTestEntry) async throws {
try await entry.execute()
}
}
#endif
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ targets += [
name: "\(packageLibraryName)Tests",
dependencies: [
.init(stringLiteral: packageLibraryName), // Preserve the computed target name used throughout this manifest.
.product(name: "Compatibility Testing Library", package: "compatibility"),
],
path: "Development/ParticleEffectsTests"
),
Expand All @@ -142,7 +143,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.2"),
.package(url: "https://github.com/kudit/Compatibility.git", from: "1.19.0"),
],
targets: targets
)