C# · native source coverage

Every core line and branch is exercised.

The native seven-method MSTest inventory collects Cobertura evidence for the VanillaTest assembly. CI rejects the run unless both instrumented line and branch coverage are exactly 100%.

Latest published native metrics

Loading C# coverage…

MetricPercentCovered
Executable lines100%All instrumented lines
Branches100%All instrumented branches

Measured scope

The run executes the seven native methods in VanillaTest.Tests and instruments only the production VanillaTest.dll module. The test assembly is excluded from the totals. The measured package code is the net8.0 core even though the repository's current test project runs on .NET 10.

The inventory covers:

  • empty-suite reporting, cached result identity, and final suite state;
  • first-decision behavior, undecided failure, numbering, ordering, and exact report rendering;
  • all five typed lifecycle transition errors without unintended state changes;
  • suite isolation and exact Unicode descriptions;
  • stable exception messages, null rejection, and undefined enum rejection; and
  • read-only result snapshots.
Keep unlike evidence separate.

Native coverage answers which instrumented C# lines and branches ran. The browser lane separately proves that the multi-file AppBundle loads and that the same seven MSTest methods complete under .NET WebAssembly. Browser adapter checks are not merged into the source percentage.

Reproduce the collection

dotnet test dotnet/tests/VanillaTest.Tests/VanillaTest.Tests.csproj \
  --configuration Release \
  --collect:"Code Coverage" \
  --settings dotnet/coverage.runsettings

The runsettings select only VanillaTest.dll, exclude the test assembly, and request Cobertura output. CI then locates the generated XML and applies the repository's exact gate:

node dotnet/scripts/build-coverage-report.js \
  path/to/coverage.cobertura.xml \
  csharp-coverage

The report builder validates the Cobertura counts and rates, fails unless covered equals valid and the rate is 100% for both metrics, then emits coverage-summary.json and coverage.cobertura.xml.

Browser compatibility is its own gate

dotnet vanilla-test --browser publishes the core test project through a generated .NET 10 browser-wasm host. The live page checks its visible site content, runtime import, target label, and complete seven-method MSTest summary. That proves a different property than native instrumentation.

Interpret 100% narrowly

  • Coverage proves execution of instrumented source, not correctness by itself.
  • Line and branch metrics come from .NET's Cobertura collector; they are not V8 ranges or Rust LLVM regions.
  • The custom browser adapter and generated reflection host have separate behavioral and tool tests.
  • The published files are tied to the successful main workflow that produced them.

Coverage and performance remain separate records

The native and browser benchmarks are published independently with raw samples and commit, runtime, protocol, and machine provenance. Their timing is not inferred from this coverage run.

Read the C# benchmark status →