aboutsummaryrefslogtreecommitdiff
path: root/tests/test-config-utilities--compile-this-elisp-buffer.el
Commit message (Collapse)AuthorAgeFilesLines
* test: repair the seven files red under Emacs 31.1HEADmainCraig Jennings10 hours1-47/+91
| | | | | | | | | | | | | None of the seven was a config regression. Each file had its own cause: - config-utilities: the tests mocked fboundp with cl-letf. fset on a subr autoloads comp-run, which requires bytecomp, whose defun of byte-compile-file replaced the mock installed earlier in the same cl-letf. 30.2 hid it because ert happened to load bytecomp first. I extracted cj/--compile-elisp-file with an injectable availability predicate (fboundp by default), made cj/compile-this-elisp-buffer the wrapper, and had the tests inject a predicate instead of redefining a primitive. Added the missing no-compiler case. - system-defaults-functions: the file let-bound use-package-always-ensure before anything declared it special. 30.2 downgraded that to a "Failed to parse package recentf" warning; 31.1 moves the defcustom to autoload time, where it is fatal at load. One defvar before the let. - calibredb-epub-config: the jump tests stubbed calibredb while it was still an autoload, so the module's require loaded the real definition over the stub and the real command always ran. Require calibredb before any stub. - agenda-query--render: org 9.8.7 parses the priority cookie with (looking-at org-priority-regexp), whose lazy prefix swallows everything between the stars and the cookie. The fixture now has no cookie and pins that the keyword is not recognised. - prog-general-yas-activation: python-ts-mode prompts to install a missing grammar, which a batch run cannot answer. The test skips on treesit-ready-p rather than on the mode existing, and the module comment says why. - integration-recurring-events: the fixtures are America/Chicago and the assertions expect Chicago rendering, so the file only passed on a machine in Central time. TZ is pinned in setup and restored in teardown. The integration failure had been invisible since 08-17 because make test stops after a red unit phase. make test exits 0 again for the first time since then.
* test: make subr mocks variadic for native-comp, add arity meta-testCraig Jennings2026-06-211-4/+4
| | | | | | | | Re-enabling native-comp surfaced a suite-wide fragility. When a test redefines a C primitive (or a native-compiled function), native-comp routes native callers through a trampoline that calls the mock with the primitive's maximum arity. A fixed-arity mock narrower than the primitive then throws wrong-number-of-arguments, intermittently, as the eln-cache fills. I swept every arity-narrow subr mock to append &rest _ (188 sites, preserving any named args the body uses), and added tests/test-meta-subr-mock-arity.el, which fails make test on any subr mock too narrow for the primitive's arity. The rule isn't "never mock a subr". The suite mocks message and completing-read freely. It's "a subr mock must accept the primitive's arity." Background, the three failure modes, and the research are in docs/native-comp-subr-mocking.org.
* test(config-utilities): cover with-timer, compile-buffer, summary, info commandsCraig Jennings2026-04-301-0/+95
Four new test files extending the existing coverage of cj/emacs-build--format-build-time. The interactive heavyweights (cj/recompile-emacs-home, cj/delete-emacs-home-compiled-files, cj/benchmark-this-method, cj/validate-org-agenda-timestamps) are out of scope for this pass — each needs an internal/wrapper split first before tests can exercise the logic without UI. - with-timer macro: 4 tests asserting it returns the FORMS' value, evaluates the body exactly once, emits both announce and done messages, and returns the last form when given multiple. - cj/compile-this-elisp-buffer: 6 tests dispatching across native-async, native-sync, and byte-compile fallbacks, plus the not-elisp / no-buffer-file-name error paths and the sync-native error catch. - cj/emacs-build--summary-string: 5 tests asserting the shape of the multi-line report (Version, System, Build date, Capabilities section, yes/no flag rendering) without locking exact wording. - info-commands smoke: 5 tests exercising cj/info-emacs-build, cj/info-loaded-packages, cj/info-loaded-features, cj/reload-init-file, and cj/org-alert-list-timers via boundary-mocked pop-to-buffer and load-file, asserting buffer creation, content shape, or echo-area message as appropriate. 20 new tests, all passing. Full suite green.