aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-04-03 07:06:00 +0200
committerJunio C Hamano <gitster@pobox.com>2025-04-07 14:47:38 -0700
commit8d531a9d18d658f696de5a71458e832317b7ca5a (patch)
treef9ac2b425d1aab2c5703f69deb9ed328a339e0d1
parent267143f28659fb6868dd73e44bf06e3e26976666 (diff)
downloadgit-8d531a9d18d658f696de5a71458e832317b7ca5a.tar.gz
Makefile: stop requiring Perl when running tests
The Makefile for our tests has a couple of targets that depend on Perl. Adapt those targets to only run conditionally in case Perl is available on the system so that it becomes possible to run the test suite without Perl. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--t/Makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/t/Makefile b/t/Makefile
index 2994eb5fa9..791e0a0978 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -59,16 +59,21 @@ CHAINLINTSUPPRESS = GIT_TEST_EXT_CHAIN_LINT=0 && export GIT_TEST_EXT_CHAIN_LINT
all:: $(DEFAULT_TEST_TARGET)
-test: pre-clean check-chainlint check-meson $(TEST_LINT)
+test: pre-clean check-meson $(TEST_LINT)
$(CHAINLINTSUPPRESS) $(MAKE) aggregate-results-and-cleanup
+ifneq ($(PERL_PATH),)
+test: check-chainlint
+prove: check-chainlint
+endif
+
failed:
@failed=$$(cd '$(TEST_RESULTS_DIRECTORY_SQ)' && \
grep -l '^failed [1-9]' *.counts | \
sed -n 's/\.counts$$/.sh/p') && \
test -z "$$failed" || $(MAKE) $$failed
-prove: pre-clean check-chainlint $(TEST_LINT)
+prove: pre-clean $(TEST_LINT)
@echo "*** prove (shell & unit tests) ***"
@$(CHAINLINTSUPPRESS) TEST_OPTIONS='$(GIT_TEST_OPTS)' TEST_SHELL_PATH='$(TEST_SHELL_PATH_SQ)' $(PROVE) --exec ./run-test.sh $(GIT_PROVE_OPTS) $(T) $(UNIT_TESTS)
$(MAKE) clean-except-prove-cache
@@ -132,8 +137,13 @@ check-meson:
fi; \
done
-test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
+test-lint: test-lint-duplicates test-lint-executable \
test-lint-filenames
+ifneq ($(PERL_PATH),)
+test-lint: test-lint-shell-syntax
+else
+GIT_TEST_CHAIN_LINT = 0
+endif
ifneq ($(GIT_TEST_CHAIN_LINT),0)
test-lint: test-chainlint
endif