<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-test-runner.el, branch main</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-04T04:43:42+00:00</updated>
<entry>
<title>fix: scope test-runner state by project</title>
<updated>2026-05-04T04:43:42+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-04T04:43:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=f674e607cc4e3520b0da3281d36d344a6b24b0a2'/>
<id>urn:sha1:f674e607cc4e3520b0da3281d36d344a6b24b0a2</id>
<content type='text'>
`test-runner.el` stored `cj/test-focused-files` and `cj/test-mode` in single global variables. ERT tests loaded by `cj/test-load-all` accumulated in the same global registry across projects. Switching projects inherited the previous project's focused files and mode. `cj/test-run-all` then ran every loaded ERT test from every project visited this session.

I introduced a per-project state hash, `cj/test-project-states`, keyed by Projectile project root (or `default-directory` when not in a project). New helpers `cj/test--state-get` and `cj/test--state-put` route each read and write through that hash, so the focused-files list and the all/focused mode now live per project. The legacy public variables `cj/test-focused-files` and `cj/test-mode` are kept. They mirror the active project's state via `cj/test--sync-legacy-state` so existing modeline indicators and external code keep working.

I also tracked which project roots had loaded tests (`cj/test-loaded-project-roots`) and added two ERT-isolation helpers. `cj/test--current-project-test-names` filters ERT's full registry to tests whose source file lives under the current project root. `cj/ert-clear-tests` deletes ERT tests loaded from other known project roots, so a fresh project starts with only its own tests. `cj/test-run-all` now uses the filtered name list, and a `projectile-after-switch-project-hook` clears foreign tests automatically when you switch projects.

I added four regression tests to `tests/test-test-runner.el`: focus state isolated per project, mode isolated per project, `cj/ert-clear-tests` keeps the current project's tests and removes others, and `cj/test--current-project-test-names` returns only the current project's tests. Each test creates throwaway projects under the test temp dir and stubs `projectile-project-root` to switch contexts.

33 test-runner tests pass together.
</content>
</entry>
<entry>
<title>Revert "checking in modified/removed tests and other misc changes"</title>
<updated>2025-11-14T08:35:00+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-14T08:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=2312e40358a923fe72785af504c9272506d8d58d'/>
<id>urn:sha1:2312e40358a923fe72785af504c9272506d8d58d</id>
<content type='text'>
This reverts commit 1218bae708a6755e3628f15fef58e6806ac81039.
</content>
</entry>
<entry>
<title>checking in modified/removed tests and other misc changes</title>
<updated>2025-11-14T08:31:16+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-14T08:31:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=1218bae708a6755e3628f15fef58e6806ac81039'/>
<id>urn:sha1:1218bae708a6755e3628f15fef58e6806ac81039</id>
<content type='text'>
</content>
</entry>
<entry>
<title>feat:test-runner: Enhance ERT test runner with focus/unfocus support</title>
<updated>2025-10-27T05:53:22+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-10-27T05:53:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=78d4c4886f1bf2307ead8e6b469e389e0422a059'/>
<id>urn:sha1:78d4c4886f1bf2307ead8e6b469e389e0422a059</id>
<content type='text'>
Add comprehensive documentation and workflow details for the ERT
test runner, including integration with Projectile projects for
automatic test discovery.

Refactor code to support focus/unfocus workflows, allowing
developers to efficiently manage test execution by focusing on
specific test files.

Introduce internal utility functions `cj/test--do-*` to modularize
logic for file operations and focus management, improving code
maintainability.

Add new tests in `test-test-runner.el` to validate the enhanced
functionality, ensuring robust handling of focus operations and test
execution scenarios.
</content>
</entry>
</feed>
