aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--todo.org73
1 files changed, 45 insertions, 28 deletions
diff --git a/todo.org b/todo.org
index 5ce68014..c4d3ea88 100644
--- a/todo.org
+++ b/todo.org
@@ -285,18 +285,32 @@ created (=one-window-p= still t). Existing tests dropped their
=pop-to-buffer= stub since =switch-to-buffer= works directly in batch.
Full =make test-unit= green.
-** TODO [#B] Add ERT coverage for modules below 70% :tests:
+** DONE [#B] Add ERT coverage for modules below 70% :tests:
+CLOSED: [2026-05-14 Thu]
Coverage snapshot from =make coverage= on 2026-05-14 (post-push):
-=5932/6857= executable lines covered (=86.5%=) across 73 tracked module files.
+=5958/6861= executable lines covered (=86.8%=) across 73 tracked module files.
+
+All tracked modules now sit at 70% or above. The two stragglers
+(=system-defaults.el= and =system-commands.el=) were resolved by
+attacking the instrumentation pattern rather than adding more tests:
+
+- =system-defaults.el= 8.3% -> 100%: switched the helper-functions
+ test from per-test =(load ...)= reloads inside =cl-letf= to a
+ single top-level =(require 'system-defaults)= wrapped in stubs,
+ so undercover sees one load instead of N reloads.
-Only two tracked modules remain below 70%:
-- =system-defaults.el= (8.3%) -- blocked on the sandboxed =(load ...)=
- instrumentation gap. See the child task below.
-- =system-commands.el= (69.4%) -- the only uncovered lines are an
- =interactive= form and a =run-at-time= lambda body that don't
- register under the =.elc=-based coverage harness even when the
- logic is exercised by existing tests.
+- =system-commands.el= 69.4% -> 100%: switched =cj/system-cmd='s
+ =(interactive (list (read-shell-command ...)))= to the equivalent
+ string spec =(interactive "sSystem command: ")=, which lets
+ undercover instrument the function body that was previously
+ showing as 0 hits, plus added one test that captures and invokes
+ the =run-at-time= lambda body directly.
+
+Lesson for future coverage work: when ERT tests exercise a function
+but the body shows 0 hits, suspect undercover/edebug instrumentation
+failing on a specific Lisp form (=interactive= with a destructured
+spec, backquote-destructured =pcase-let=, etc.), not the tests.
*** DONE [#B] Add ERT tests for =modules/prog-python.el= (21/21, 100.0%) :tests:
CLOSED: [2026-05-14 Thu]
@@ -305,29 +319,32 @@ CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/prog-webdev.el= (21/21, 100.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/calibredb-epub-config.el= (95/133, 71.4%) :tests:
-*** TODO [#B] Add ERT tests for =modules/system-defaults.el= (1/12, 8.3%) :tests:
-=tests/test-system-defaults-functions.el= ships 8 tests covering the
-helpers (cj/disabled, the two minibuffer-gc hooks,
-unpropertize-kill-ring, cj/log-comp-warning). Coverage still reads
-1/12 because the sandboxed =(load ...)= used to bypass system-defaults'
-startup side effects doesn't register with undercover's instrumentation;
-the function bodies execute under test but the gauge can't credit them.
-Closing this child task needs either a refactor that lets the module
-load via =(require)= cleanly in batch, or a switch to a different
-instrumentation strategy.
+*** DONE [#B] Add ERT tests for =modules/system-defaults.el= (12/12, 100.0%) :tests:
+CLOSED: [2026-05-14 Thu]
+Rewrote =tests/test-system-defaults-functions.el= to call
+=(require 'system-defaults)= once at top level (with the
+side-effecting primitives stubbed via =cl-letf= wrapping the
+require) instead of looping per-test =(load ...)= reloads inside
+=cl-letf=. Undercover only saw the first load, so the function
+bodies showed as uncovered even though every test ran them. Loading
+once -- with the same stubs -- fixed the gauge and pulled coverage
+to 12/12. Added two more tests to exercise the previously-unhit
+list-without-comp guard and the non-string-message format branch.
*** DONE [#B] Add ERT tests for =modules/ui-navigation.el= (46/48, 95.8%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/prog-go.el= (24/27, 88.9%) :tests:
CLOSED: [2026-05-14 Thu]
-*** TODO [#B] Add ERT tests for =modules/system-commands.el= (34/49, 69.4%) :tests:
-Logic is covered by =tests/test-system-commands-resolve-and-run.el= and
-=tests/test-system-commands-keymap.el=. The remaining uncovered lines
-are the =interactive= form for =cj/system-cmd= and the inner lambda
-body in the =run-at-time= callback inside =cj/system-cmd-restart-emacs=
--- both register as uncovered under the =.elc=-based instrumentation
-even though the surrounding code paths execute under test. Closing
-this needs the same instrumentation-strategy fix as
-=system-defaults.el=, or accept the gauge floor and close anyway.
+*** DONE [#B] Add ERT tests for =modules/system-commands.el= (51/51, 100.0%) :tests:
+CLOSED: [2026-05-14 Thu]
+The =interactive= form on =cj/system-cmd= was =(interactive (list
+(read-shell-command "...")))= -- a destructured list form. Edebug-
+based undercover instrumentation didn't see past it, so the function
+body registered 0 hits even though the tests called it directly.
+Switched to the equivalent string spec =(interactive "sSystem
+command: ")= and the body instrumented as expected. Added one more
+test that captures the =run-at-time= lambda inside
+=cj/system-cmd-restart-emacs= and invokes it directly so the inner
+=call-process-shell-command= branch registers as covered.
*** DONE [#B] Add ERT tests for =modules/external-open.el= (31/33, 93.9%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/org-webclipper.el= (59/59, 100.0%) :tests: