test(m9): convert pure core suites to XCTest (Slice 2) #106

Merged
gronod merged 1 commits from feat/m9-slice2-xctest-core-pure into milestone/m9-monterey 2026-09-11 21:06:35 +01:00
Owner

Slice 2 (Phase 1a) of the M9 retarget: converts the pure Core test suites (deterministic, no process spawning) from Swift Testing to XCTestCase.

Converted files (26)

  • Arg builders: ArgsBuilder, Targen, Printtarg, Printcal, Applycal, Colprof, CalibrationTargen, Iccgamut, Lp, Profcheck, CupsOptionsFilter
  • Parsers / colour math / geometry: CGATSParser, CupsParser, ProfcheckParser, GamutMeshParser, GamutGeometryBuilder, MeasurementTests (InstrumentParser, ChartreadArgs, ChartreadClassifier, ChartreadRow, ColourMath, MeasurementArtefacts, AverageArgs), ColprofProgress, DriftAlert, CalibrationIdentity
  • Files/formatting: ArtefactFiles (incl. ArtefactProbeProfile), AppPaths (+WizardStage), FileHelpers, BinaryResolver
  • Pure suites split out of ProcessManagerTests.swift: ProcessLineDecoder, JSONAccumulator, LogSanitizer (the ProcessManager suite itself stays on Swift Testing pending Slice 3)

Helper

Tests/ICCeryCoreTests/XCTestCase+AsyncThrows.swift adds assertAsyncThrows(expectedType:) for the 11 await #expect(throws:) sites (converted in Slice 3).

TestAppEnvironment.swift dropped its unused import Testing.

Deferred (untouched, still import Testing)

ProcessManagerTests suite, ArgyllRunner*Tests ×3 (+ embedded runner suites in TargenTests/PrinttargTests), ProcessRunSupportTests, ProfileInstallerTests, CalibrationStoreTests, JSONFileStoreTests, SettingsTests, PresetTests, PresetViewModelMappingTests, PrintPanelTests, TargetWorkflowViewModelTests, VerificationHistoryStoreTests, WizardCalibrationSessionTests, WizardGatingTests.

Slice-1 build fix (unavoidable)

CGATSParser.swift: six throw .case expressions qualified as CGATSParseError.*. Bare implicit-member throws only compile under typed throws, which Slice 1 demoted to untyped throws — the ICCeryCore target did not build after PR #105. This is a 6-line production fix required for any test gate to run.

Verification

ICCeryCore + ICCeryCoreTests compile under -target arm64-apple-macos12.0 -swift-version 5: all 24 converted pure files typecheck against the built ICCeryCore module (the two files importing the app target — CupsOptionsFilterTests, GamutGeometryBuilderTests — parse cleanly and are gated by Slice 4's Observation→Combine migration, per megaplan). The full xcodebuild test gate cannot pass until Slice 4 demotes @Observable in the app target — the Slice-2 gate per megaplan is standalone compilation, which passes.

Assignee: gronod

Slice 2 (Phase 1a) of the M9 retarget: converts the pure Core test suites (deterministic, no process spawning) from Swift Testing to `XCTestCase`. ## Converted files (26) - Arg builders: ArgsBuilder, Targen, Printtarg, Printcal, Applycal, Colprof, CalibrationTargen, Iccgamut, Lp, Profcheck, CupsOptionsFilter - Parsers / colour math / geometry: CGATSParser, CupsParser, ProfcheckParser, GamutMeshParser, GamutGeometryBuilder, MeasurementTests (InstrumentParser, ChartreadArgs, ChartreadClassifier, ChartreadRow, ColourMath, MeasurementArtefacts, AverageArgs), ColprofProgress, DriftAlert, CalibrationIdentity - Files/formatting: ArtefactFiles (incl. ArtefactProbeProfile), AppPaths (+WizardStage), FileHelpers, BinaryResolver - Pure suites split out of `ProcessManagerTests.swift`: ProcessLineDecoder, JSONAccumulator, LogSanitizer (the `ProcessManager` suite itself stays on Swift Testing pending Slice 3) ## Helper `Tests/ICCeryCoreTests/XCTestCase+AsyncThrows.swift` adds `assertAsyncThrows(expectedType:)` for the 11 `await #expect(throws:)` sites (converted in Slice 3). `TestAppEnvironment.swift` dropped its unused `import Testing`. ## Deferred (untouched, still `import Testing`) ProcessManagerTests suite, ArgyllRunner*Tests ×3 (+ embedded runner suites in TargenTests/PrinttargTests), ProcessRunSupportTests, ProfileInstallerTests, CalibrationStoreTests, JSONFileStoreTests, SettingsTests, PresetTests, PresetViewModelMappingTests, PrintPanelTests, TargetWorkflowViewModelTests, VerificationHistoryStoreTests, WizardCalibrationSessionTests, WizardGatingTests. ## Slice-1 build fix (unavoidable) `CGATSParser.swift`: six `throw .case` expressions qualified as `CGATSParseError.*`. Bare implicit-member throws only compile under typed throws, which Slice 1 demoted to untyped `throws` — the ICCeryCore target did not build after PR #105. This is a 6-line production fix required for any test gate to run. ## Verification ICCeryCore + ICCeryCoreTests compile under `-target arm64-apple-macos12.0 -swift-version 5`: all 24 converted pure files typecheck against the built ICCeryCore module (the two files importing the app target — CupsOptionsFilterTests, GamutGeometryBuilderTests — parse cleanly and are gated by Slice 4's Observation→Combine migration, per megaplan). The full `xcodebuild test` gate cannot pass until Slice 4 demotes `@Observable` in the app target — the Slice-2 gate per megaplan is standalone compilation, which passes. Assignee: gronod
gronod added 1 commit 2026-09-11 20:44:01 +01:00
Slice 2 (Phase 1a) of the M9 Monterey retarget. Converts all pure Core
suites (argv builders, CGATS/CUPS/profcheck/gamut-mesh parsers, colour
math, file/artefact helpers, classifiers) to XCTestCase, and adds the
shared assertAsyncThrows helper for the async-throws sites that Slice 3
will convert.

Deferred to Slice 3 (kept on Swift Testing in mixed files):
ProcessManagerTests, ArgyllRunner*Tests, ProcessRunSupportTests,
store/UI suites, and the runner suites embedded in TargenTests /
PrinttargTests / ProcessManagerTests.

Also qualifies six bare `throw .case` expressions in CGATSParser with
CGATSParseError — they only compiled under typed throws, which Slice 1
demoted to untyped `throws`; without this the ICCeryCore target fails to
build and no test gate can run.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
gronod merged commit 83f3a4f0e2 into milestone/m9-monterey 2026-09-11 21:06:35 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/iccery-v2-mac#106