You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2849a1b
Browse filesBrowse the repository at this point in the historyBrowse files
Add native C++ coverage via OpenCppCoverage (Codecov flag: native)
dotnet-coverage is CLR-only, so the two native Unit++ executables
(testGenericLib.exe, TestViews.exe) contributed nothing to the coverage
uploaded from CI. OpenCppCoverage fills that gap: it is free (GPL-3,
run-only in CI), debugger-based (needs only the PDBs already produced
by a Debug build), exports Cobertura natively, and never rewrites
binaries in the shared Output/<Configuration> folder - the same
constraint that disqualified coverlet for the managed side.
Validated locally against a Debug build (OpenCppCoverage 0.9.9.0 x64):
- Fidelity: identical Unit++ summaries under coverage
(testGenericLib [31-0-0], TestViews [301-0-0]), exit code 0, no
assert dialogs or hangs, including testGenericLib's deliberate
test-induced native assert
- Exit codes: OpenCppCoverage propagates the child's non-zero exit
code (verified by forcing a failing run); the wrapper additionally
parses the Unit++ summary line, matching Invoke-CppTest.ps1 policy
- Overhead: testGenericLib ~0.4s -> ~1.3s, TestViews ~5s -> ~20s
(~4x, debugger-based collection)
- Output: ~51% native line coverage across Views.dll, DebugProcs.dll
and the statically linked Generic sources; ReportGenerator 5.3.11
parses the native cobertura files alone and merged with the managed
one
Changes:
- Add Build/Agent/Run-NativeCoverage.ps1: opt-in post-build re-run of
both exes under OpenCppCoverage with the same assert-dialog
suppression and DistFiles environment as the regular native test
run. Writes Output/<Configuration>/TestResults/
native.<exe>.cobertura.xml plus its own <exe>.exe.coverage.log,
leaving the canonical <exe>.exe.log files untouched. Cobertura paths
are rewritten repo-relative so Codecov matches files on any checkout
path without environment-specific fixes
- Consolidate duplicated test-run plumbing into FwBuildHelpers.psm1:
Set-TestAssertDialogEnvironment (was copied in test.ps1 and
Invoke-CppTest.ps1), Disable-CrashDialog (SetErrorMode P/Invoke),
and Get-UnitppSummary (Unit++ summary-line parsing), consumed by
test.ps1, Invoke-CppTest.ps1, and the new coverage script
- CI: install OpenCppCoverage 0.9.9.0 (pinned) via choco, collect
native coverage after the test run, and upload under flags: native /
name: FieldWorks-native - deliberately separate from the managed
upload so the two pipelines stay independently diagnosable
- Extract the Codecov retry/verify step sequence into a local
composite action (.github/actions/codecov-upload) used by both the
managed and native uploads, so the retry policy and pinned action
SHA live in one place
- codecov.yml: ignore native Unit++ test sources (Src/Generic/Test,
Src/views/Test), matching the existing managed test-source ignore
- Update fieldworks-test-coverage skill notes for the native path
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/skills/fieldworks-test-coverage/SKILL.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,4 +40,5 @@ You will receive:
40
40
- See `verify-test` for the broader build/test verification flow this slots into.
41
41
- See `execute-implement`'s self-check step, which references this skill for new logic.
42
42
-`test.ps1 -Coverage` restores the local dotnet tool manifest automatically (`dotnet-coverage` collects the raw `coverage.cobertura.xml`; ReportGenerator renders the summary/HTML). On PRs, Codecov reports the same data as a patch-coverage check.
43
+
-`test.ps1 -Coverage` covers managed code only (`dotnet-coverage` is CLR-based). For native C++ changes (`Src/Generic`, `Src/views`), run `.\Build\Agent\Run-NativeCoverage.ps1 -Configuration Debug` after a `-BuildTests` build: it re-runs `testGenericLib.exe`/`TestViews.exe` under OpenCppCoverage (install via `choco install opencppcoverage`; debugger-based, needs only PDBs, never rewrites binaries in the shared Output folder) and writes `Output/<Configuration>/TestResults/native.<exe>.cobertura.xml`, which ReportGenerator accepts alongside the managed file. Overhead is ~4x wall time (TestViews ~5s bare, ~20s covered). CI uploads these under the Codecov flag `native`, separate from `managed`.
0 commit comments