Two tiers of tests, both run by default on every swift test invocation.
- Unit (
Tests/): defaultswift test. Mocked drivers, no hardware. Fast. - Integration (
Tests/Integration/): defaultswift test. Cross-layer with mocks (binding ↔ store, view layout, source ↔ bus ↔ output flow). Some integration tests use REAL drivers and self-skip viaXCTSkipwhen the specific hardware isn't present on the running machine.
CI runs both tiers on every push. Hardware-dependent tests self-skip on cloud Mac runners that lack a built-in display, keyboard backlight, accessible audio output device, etc.
To force-fail the suite when a hardware test is skipped, run with the explicit assertion:
swift test --package-path .and verify "skipped" count is what you expect for your machine.
IntegrationTestCase—@MainActor, no environment flag required by default. Subclasses can overriderequiresEnvironmentFlagto gate a specific test class on an env var. Real-driver tests inherit this class and self-skip viaXCTSkipwhen the specific hardware isn't present.
| Test scenario | Tier |
|---|---|
| Pure function with no side effects | Unit |
| Mock-driven driver behavior, single layer | Unit |
| SwiftUI binding → SettingsStore writes a specific keyPath | Integration |
| Layout invariants under presence-flag combinations | Integration |
| Source → ReactionBus → Output through real types (mock drivers) | Integration |
| Real CoreAudio / CoreBrightness / IOHIDManager round-trip | Integration (real-driver, self-skip on absent hardware) |
| Bundle resource discovery against the running process | Integration (real-driver, self-skip in SPM context) |
# Full suite (unit + integration, hardware tests self-skip when absent):
swift test
# Integration tier only:
swift test --filter Integration
# Direct-build-only suite (Volume Override + Updater paths):
swift test -Xswiftc -DDIRECT_BUILDYamete._testSetHardwarePresence(...)— drives every IOKit / DisplayServices presence flag without touching real hardware. Used byPanelLayoutTeststo assert layout invariants under every combination of haptic / brightness / tint / trackpad / mouse / keyboard presence.AudioPlayer._testInjectSoundLibrary(_:duration:)— synthetic sound library forpeekSoundtests; the SPM test bundle has nosounds/directory so the production preload path leaves the player empty.*Section.*KeyPathsstatic helpers — single source of truth between view rendering and binding-integrity assertions. SeeBindingIntegrityTestsfor usage.