test-guard.mk: Add file #70
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/feature/20260818-test-guard-mk-add-file"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
test-guard.mk: Add file
Running
make cleanin some directories can breakmake testin others. That notably happens by runningmake cleansomewhere in or below$(TOPDIR)/src/python, which removes__init__.pyfiles 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
testabilitycan use it as a prerequisite. This commit does that withpy-run.mkandjw-py-test.mk.Testability is asserted by running
make,make allormake testfrom$(TOPDIR). A successful toplevel build coincides with testability, and leaves a$(TOPDIR)/dirs-all.donebehind, which is why that file is the perfect testability marker.It is automatically created by a toplevel build and cleared by using the
invalidate-testabilityprerequisite. This commit makes targetcleandepend on it inpy-mod.mk. To be extended to other use cases / makefile snippets as needed.1c39215b39c42f5f98ab