Skip to content

Conversation

@rtfeldman
Copy link
Contributor

Summary

  • Expand zig build coverage to include src/check/ in addition to src/parse/
  • Add check module unit tests to coverage run
  • Report parser and type checker coverage separately
  • Set type checker coverage threshold to 83%
  • Add exhaustiveness tests for F32/F64/Dec literal patterns
  • Add tests for type mismatch error paths (match branches, if branches, bool ops)

Test plan

  • zig build test-check passes
  • zig build coverage passes with 83%+ type checker coverage
  • CI passes

🤖 Generated with Claude Code

rtfeldman and others added 8 commits December 31, 2025 15:09
- Add MIN_COVERAGE_PERCENT check that fails build if coverage drops below 84%
- Exclude HTML.zig (playground visualization) from coverage
- Exclude std.debug.print/panic lines from coverage
- Add snapshot tests for pizza operator, caret operator, and malformed numbers

The threshold can be gradually increased as more tests are added.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When kcov's total_lines is 0, it means the tool couldn't capture
coverage data (likely due to older kcov version not supporting
Zig binaries). In this case, skip the threshold enforcement and
print a helpful message. Coverage will still be enforced in the
nix environment which has a newer kcov version.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Regenerated snapshots to include new sections (FORMATTED, CANONICALIZE, TYPES)
that were added to the snapshot tool. The caret (^) and pizza (|>) operators
are tokenized but not yet implemented as binary operators in the parser,
so they parse only the first operand.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove broken kcov step from check-once (Ubuntu apt kcov is too old)
- Coverage runs properly in nix environment in zig-tests job
- parseCoverageJson now returns error instead of silently failing
- Add kcov exclusions for HTML.zig and debug print statements

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
kcov doesn't work with musl-linked binaries, so add a native ubuntu-24.04
build without target_flag specifically for running coverage. The coverage
step now only runs when there's no target flag set.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Expand coverage to include src/check/ in addition to src/parse/
- Add check module unit tests to coverage run
- Report parser and type checker coverage separately
- Set type checker coverage threshold to 83%
- Add exhaustiveness tests for F32/F64/Dec literal patterns
- Add tests for type mismatch error paths (match branches, if branches, bool ops)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When kcov doesn't capture any coverage data (reports 0 total lines),
skip enforcing coverage thresholds rather than failing. This can happen
with older kcov versions that don't fully support Zig-generated binaries.

Coverage will still be enforced in environments with newer kcov versions.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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