mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-20 21:31:28 +02:00
BUILD: makefile: implement support for running a command in range
When running "make range", it would be convenient to support running reg tests or anything else such as "size", "pahole" or even benchmarks. Such commands are usually specific to the developer's environment, so let's just pass a generic variable TEST_CMD that is executed as-is if not empty. This way it becomes possible to run "make range RANGE=... TEST_CMD=...".
This commit is contained in:
parent
f8acac653e
commit
90b70b61b1
3
Makefile
3
Makefile
@ -1283,6 +1283,8 @@ unit-tests:
|
|||||||
# options for all commits within RANGE. RANGE may be either a git range
|
# options for all commits within RANGE. RANGE may be either a git range
|
||||||
# such as ref1..ref2 or a single commit, in which case all commits from
|
# such as ref1..ref2 or a single commit, in which case all commits from
|
||||||
# the master branch to this one will be tested.
|
# the master branch to this one will be tested.
|
||||||
|
# Will execute TEST_CMD for each commit if defined, and will stop in case of
|
||||||
|
# failure.
|
||||||
|
|
||||||
range:
|
range:
|
||||||
$(Q)[ -d .git/. ] || { echo "## Fatal: \"make $@\" may only be used inside a Git repository."; exit 1; }
|
$(Q)[ -d .git/. ] || { echo "## Fatal: \"make $@\" may only be used inside a Git repository."; exit 1; }
|
||||||
@ -1308,6 +1310,7 @@ range:
|
|||||||
echo "[ $$index/$$count ] $$commit #############################"; \
|
echo "[ $$index/$$count ] $$commit #############################"; \
|
||||||
git checkout -q $$commit || die 1; \
|
git checkout -q $$commit || die 1; \
|
||||||
$(MAKE) all || die 1; \
|
$(MAKE) all || die 1; \
|
||||||
|
[ -z "$(TEST_CMD)" ] || $(TEST_CMD) || die 1; \
|
||||||
index=$$((index + 1)); \
|
index=$$((index + 1)); \
|
||||||
done; \
|
done; \
|
||||||
echo;echo "Done! $${count} commit(s) built successfully for RANGE $${RANGE}" ; \
|
echo;echo "Done! $${count} commit(s) built successfully for RANGE $${RANGE}" ; \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user