aboutsummaryrefslogtreecommitdiff
path: root/tests/test-test-runner.el
Commit message (Collapse)AuthorAgeFilesLines
* fix: scope test-runner state by projectCraig Jennings2026-05-031-0/+123
| | | | | | | | | | | | `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.
* Revert "checking in modified/removed tests and other misc changes"Craig Jennings2025-11-141-0/+359
| | | | This reverts commit 1218bae708a6755e3628f15fef58e6806ac81039.
* checking in modified/removed tests and other misc changesCraig Jennings2025-11-141-359/+0
|
* feat:test-runner: Enhance ERT test runner with focus/unfocus supportCraig Jennings2025-10-271-0/+359
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.