test infra: re-run tests when their own sources change - #90
Open
andreykarpenko-qc wants to merge 1 commit into
Open
test infra: re-run tests when their own sources change#90andreykarpenko-qc wants to merge 1 commit into
andreykarpenko-qc wants to merge 1 commit into
Conversation
Per-test results.txt and cov.txt in scripts/Makefile.coverage depended only on $(INSTALLPATH)/manifest (sha256 of the kernel/lib/booter install). Editing a test's own sources (test.c/Makefile/etc.) left manifest unchanged, so make treated the stale results.txt as up to date and never rebuilt or re-ran the test on an incremental `make test`. The stale PASS/FAIL was reported -- the reason a full clean_build_test was needed as a workaround. Add a test_src_deps function returning a test's own source files (Makefile, tested_functions, *.c/.h/.S/.s/.cpp/.cc/.py/.dat/.cfg), excluding generator outputs (scenarios.h, generated_tests.dat, threadmap.py) to mirror the recipe's find whitelist. Enable .SECONDEXPANSION and add $(call test_src_deps,$*) as a prerequisite to both the results.txt and cov.txt pattern rules. Validated: editing a test with manifest unchanged now re-runs only that test. A/B vs pre-fix shows identical steady-state no-op behavior, so the fix adds no spurious re-runs. Signed-off-by: Andrey Karpenko <andreyk@qti.qualcomm.com>
andreykarpenko-qc
force-pushed
the
makefile_test_infra
branch
from
August 2, 2026 11:46
db60410 to
5b118ce
Compare
andreykarpenko-qc
marked this pull request as ready for review
August 5, 2026 09:45
Contributor
|
I found that with the proposed change we do have a recompilation of the relevant src files, but it isn't making the test to run again. So, if I have changed the src, but still have stale results.txt- it follows is and not the src. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per-test results.txt and cov.txt in scripts/Makefile.coverage depended only on $(INSTALLPATH)/manifest (sha256 of the kernel/lib/booter install). Editing a test's own sources (test.c/Makefile/etc.) left manifest unchanged, so make treated the stale results.txt as up to date and never rebuilt or re-ran the test on an incremental
make test. The stale PASS/FAIL was reported -- the reason a full clean_build_test was needed as a workaround.Add a test_src_deps function returning a test's own source files (Makefile, tested_functions, .c/.h/.S/.s/.cpp/.cc/.py/.dat/.cfg), excluding generator outputs (scenarios.h, generated_tests.dat, threadmap.py) to mirror the recipe's find whitelist. Enable .SECONDEXPANSION and add $(call test_src_deps,$) as a prerequisite to both the results.txt and cov.txt pattern rules.
Validated: editing a test with manifest unchanged now re-runs only that test. A/B vs pre-fix shows identical steady-state no-op behavior, so the fix adds no spurious re-runs.