Skip to content

Commit a641353

Browse files
committed
Update claude file
1 parent 1174cb1 commit a641353

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,40 @@ The `--treenode-filter` follows the pattern: `/{AssemblyName}/{Namespace}/{Class
9898
3. Disable `VerifierSettings.AutoVerify()` after accepting
9999
4. Re-run tests to confirm they pass without AutoVerify
100100

101+
### Code Coverage
102+
103+
Code coverage uses **Microsoft.Testing.Extensions.CodeCoverage** configured in `src/testconfig.json`. Coverage is collected for production assemblies only (test projects and TestModels are excluded).
104+
105+
```powershell
106+
# Run tests with code coverage (from src/ folder)
107+
dotnet test --solution ReactiveUI.Binding.SourceGenerators.slnx -c Release -- --coverage --coverage-output-format cobertura
108+
109+
# Generate HTML report using ReportGenerator (install if needed: dotnet tool install -g dotnet-reportgenerator-globaltool)
110+
# Find all cobertura files and generate report to /tmp/<folder>
111+
reportgenerator \
112+
-reports:"tests/**/TestResults/**/*.cobertura.xml" \
113+
-targetdir:/tmp/code_coverage \
114+
-reporttypes:"Html;TextSummary"
115+
116+
# View the text summary
117+
cat /tmp/code_coverage/Summary.txt
118+
119+
# Open HTML report in browser
120+
xdg-open /tmp/code_coverage/index.html # Linux
121+
open /tmp/code_coverage/index.html # macOS
122+
```
123+
124+
**Key configuration** (`src/testconfig.json`):
125+
- `modulePaths.include`: `ReactiveUI\\.Binding\\..*` — covers all production assemblies
126+
- `modulePaths.exclude`: `.*Tests.*`, `.*TestRunner.*`, `.*TestModels.*` — excludes test/runner/model assemblies
127+
- `skipAutoProperties: true` — auto-properties excluded from coverage metrics
128+
129+
**Tips:**
130+
- Always clean `bin/` and `obj/` folders before coverage runs to avoid stale results
131+
- The `ReactiveUI.Binding.GeneratedCode.TestModels` assembly has `[assembly: ExcludeFromCodeCoverage]` so it won't appear in reports even though its module path matches the include pattern
132+
- `DiagnosticWarnings.cs` coverage appears as 0% in `ReactiveUI.Binding.SourceGenerators` — this is a linked-file artifact; the code is actually tested via the `ReactiveUI.Binding.Analyzer` assembly
133+
- Put coverage reports in `/tmp/` to avoid accidentally committing them
134+
101135
## Architecture Overview
102136

103137
### What This Project Does

0 commit comments

Comments
 (0)