test-guard.mk: Add file #70

Merged
Jan Lindemann merged 1 commit from jan/feature/20260818-test-guard-mk-add-file into master 2026-08-18 17:22:44 +02:00 AGit

test-guard.mk: Add file

Running make clean in some directories can break make test in others. That notably happens by running make clean somewhere in or below $(TOPDIR)/src/python, which removes __init__.py files potentially needed by unit and integration tests in $(TOPDIR)/test.

This commit makes the failure easily visible by introducing the notion of "testabiltity" - if the tree is not testable, "make test" logs exactly that in a clear error message and gives up.

Makefiles which need to check testability can use it as a prerequisite. This commit does that with py-run.mk and jw-py-test.mk.

Testability is asserted by running make, make all or make test from $(TOPDIR). A successful toplevel build coincides with testability, and leaves a $(TOPDIR)/dirs-all.done behind, which is why that file is the perfect testability marker.

It is automatically created by a toplevel build and cleared by using the invalidate-testability prerequisite. This commit makes target clean depend on it in py-mod.mk. To be extended to other use cases / makefile snippets as needed.

#### test-guard.mk: Add file Running `make clean` in some directories can break `make test` in others. That notably happens by running `make clean` somewhere in or below `$(TOPDIR)/src/python`, which removes `__init__.py` files potentially needed by unit and integration tests in `$(TOPDIR)/test`. This commit makes the failure easily visible by introducing the notion of "testabiltity" - if the tree is not testable, "make test" logs exactly that in a clear error message and gives up. Makefiles which need to check `testability` can use it as a prerequisite. This commit does that with `py-run.mk` and `jw-py-test.mk`. Testability is asserted by running `make`, `make all` or `make test` from `$(TOPDIR)`. A successful toplevel build coincides with testability, and leaves a `$(TOPDIR)/dirs-all.done` behind, which is why that file is the perfect testability marker. It is automatically created by a toplevel build and cleared by using the `invalidate-testability` prerequisite. This commit makes target `clean` depend on it in `py-mod.mk`. To be extended to other use cases / makefile snippets as needed.
test-guard.mk: Add file
Some checks failed
CI / Packaging - Kali Linux (pull_request) Failing after 3m35s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 46s
CI / Packaging test (pull_request) Failing after 0s
1c39215b39
Running "make clean" in some directories can break "make test" in
others. That notably happens by running clean somewhere in or below
$(TOPDIR)/src/python, which removes __init__.py files potentially needed
by unit and integration tests in $(TOPDIR)/test.

This commit makes the failure easily visible by introducing the notion
of "testabiltity" - if the tree is not testable, "make test" logs
exactly that in a clear error message and gives up.

Makefiles which need to check "testability" can use it as a
prerequisite. This commit does that with py-run.mk and jw-py-test.mk.

Testability is asserted by running "make", "make all" or "make test"
from $(TOPDIR). A successful toplevel build coincides with testability,
and leaves a $(TOPDIR)/dirs-all.done behind, which is why that file is
the perfect testability marker.

It is automatically created by a toplevel build and cleared by using the
"invalidate-testability" prerequisite. This commit makes target "clean"
depend on it in py-mod.mk. To be extended to other use cases / makefile
snippets as needed.

Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-08-18 13:55:31 +02:00
Jan Lindemann force-pushed jan/feature/20260818-test-guard-mk-add-file from 1c39215b39
Some checks failed
CI / Packaging - Kali Linux (pull_request) Failing after 3m35s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 46s
CI / Packaging test (pull_request) Failing after 0s
to c42f5f98ab
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m3s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m2s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m16s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m51s
CI / Packaging test (push) Successful in 0s
2026-08-18 14:05:43 +02:00
Compare
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!70
No description provided.