Skip to content

Conversation

@rtfeldman
Copy link
Contributor

Summary

  • Expand zig build coverage to include canonicalizer tests alongside parser tests
  • Add snapshot tests for canonicalizer coverage (major improvement from 47% to 81%)
  • Add 12 new Monomorphizer unit tests (32% -> 42%)
  • Add 5 new RocEmitter unit tests (57% -> 62%)
  • Make CoverageSummaryStep configurable for multiple modules
  • Set 80% minimum coverage threshold for canonicalizer

Coverage Results

File Coverage
DependencyGraph.zig 96.6%
NodeStore.zig 95.5%
Pattern.zig 90.6%
Statement.zig 89.4%
Expression.zig 88.3%
Scope.zig 84.9%
Can.zig 80.6%
ModuleEnv.zig 80.7%
ClosureTransformer.zig 64.1%
RocEmitter.zig 61.8%
Monomorphizer.zig 42.3%

Overall: 81.45% (threshold set at 80%)

Test plan

  • zig build coverage passes with both parser and canonicalizer coverage
  • Coverage threshold enforced at 80% for canonicalizer
  • All new unit tests pass

🤖 Generated with Claude Code

rtfeldman and others added 5 commits January 1, 2026 07:39
- Expand `zig build coverage` to include canonicalizer tests
- Add snapshot tests for canonicalizer coverage (major improvement)
- Add 12 new Monomorphizer unit tests (32% -> 42%)
- Add 5 new RocEmitter unit tests (57% -> 62%)
- Make CoverageSummaryStep configurable for multiple modules
- Set 80% minimum coverage threshold for canonicalizer

Coverage improved from 47% (unit tests only) to 81% by including
snapshot tests which exercise the full canonicalization pipeline.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
kcov cannot capture coverage from cross-compiled binaries (musl target).
Added a native ubuntu-22.04 build to the matrix specifically for running
coverage tests, and modified the coverage condition to check that
target_flag is empty.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- valgrind: only run on musl cross-compile (native glibc has valgrind issues)
- static link check: only run on musl builds (native glibc is dynamically linked)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
kcov cannot capture coverage on GitHub Actions runners due to kernel
security restrictions on ptrace. Coverage can still be run locally with:
  zig build coverage

Also updated valgrind/static-link conditions to be more precise.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rtfeldman rtfeldman closed this Jan 1, 2026
@rtfeldman rtfeldman reopened this Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants