aboutsummaryrefslogtreecommitdiff
path: root/.claude/rules/elisp-testing.md
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-31 14:49:39 -0500
committerCraig Jennings <c@cjennings.net>2026-05-31 14:49:39 -0500
commit8d8a9b8ec79ec2252b098713283884aeae80038e (patch)
tree1e816cd004b408e91783ff516b3e5a028024b62f /.claude/rules/elisp-testing.md
parent12a2ce6a7eccf3a5093f7ac0dcd5b79a074a51f8 (diff)
downloaddotemacs-8d8a9b8ec79ec2252b098713283884aeae80038e.tar.gz
dotemacs-8d8a9b8ec79ec2252b098713283884aeae80038e.zip
chore(claude): sync bundle rules and add coverage-summary script
Diffstat (limited to '.claude/rules/elisp-testing.md')
-rw-r--r--.claude/rules/elisp-testing.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/.claude/rules/elisp-testing.md b/.claude/rules/elisp-testing.md
index b727cbd5..7c3a9efc 100644
--- a/.claude/rules/elisp-testing.md
+++ b/.claude/rules/elisp-testing.md
@@ -37,6 +37,12 @@ Every non-trivial function needs at least:
Missing a category is a test gap. If three cases look near-identical, parametrize with a loop or `dolist` rather than copy-pasting.
+### Measuring it — `make coverage-summary`
+
+The bundle ships a coverage summary at `.claude/scripts/coverage-summary.el` and a Makefile fragment (`coverage-makefile.txt`) with `coverage` and `coverage-summary` targets. After `make coverage` writes an undercover SimpleCov report, `make coverage-summary` prints a per-file table and a unit-weighted project number.
+
+The number to watch is the missing-file count. A module no test loads never appears in the SimpleCov report, so a line-weighted total skips it silently — the suite looks healthier than it is. The summary counts every `modules/*.el` on disk that's absent from the report as 0%, so an untested module drags the project number down where you can see it. Copy the fragment's targets into your own Makefile to adopt it; the bundle never edits your Makefile.
+
## TDD Workflow
Write the failing test first. A failing test proves you understand the change. Assume the bug is in production code until the test proves otherwise — never fix the test before proving the test is wrong.