Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Code Coverage

Code coverage tracking for NicyRuntime’s Rust codebase.

Current Status

Target: 80% line coverage for Runtime/src/

📊 Coverage reports are not yet automated. This is a planned feature.

Manual Coverage with cargo-tarpaulin

Install tarpaulin:

cargo install cargo-tarpaulin

Run coverage:

cd Runtime
cargo tarpaulin --out Html --output-dir tarpaulin-report

This generates tarpaulin-report/tarpaulin-report.html with interactive coverage data.

Manual Coverage with grcov

For coverage of tests:

# Install grcov
cargo install grcov

# Build with coverage instrumentation
cd Runtime
RUSTFLAGS="-C instrument-coverage" cargo build

# Run tests
nicy run tests/run_all.luau

# Generate report
grcov target/ -s . --binary-path target/debug/ -t html --branch --ignore-not-existing -o grcov-report/

Coverage Goals

ModuleCurrentTarget
lib.rsTBD80%
ffi_exports.rsTBD90%
require_resolver.rsTBD85%
task_scheduler.rsTBD85%
error.rsTBD90%

Future Plans

  • GitHub Actions coverage check on every PR
  • Coverage badge in README
  • Coverage regression prevention (fail PR if coverage drops > 2%)
  • Per-module coverage thresholds in CI

Contributing

When adding new features:

  1. Write tests that cover the new code paths
  2. Run cargo tarpaulin locally to verify coverage
  3. Ensure new code is at least 80% covered