Skip to content

Commit 8d531a9

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 267143f commit 8d531a9

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

t/Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,21 @@ CHAINLINTSUPPRESS = GIT_TEST_EXT_CHAIN_LINT=0 && export GIT_TEST_EXT_CHAIN_LINT
5959

6060
all:: $(DEFAULT_TEST_TARGET)
6161

62-
test: pre-clean check-chainlint check-meson $(TEST_LINT)
62+
test: pre-clean check-meson $(TEST_LINT)
6363
$(CHAINLINTSUPPRESS) $(MAKE) aggregate-results-and-cleanup
6464

65+
ifneq ($(PERL_PATH),)
66+
test: check-chainlint
67+
prove: check-chainlint
68+
endif
69+
6570
failed:
6671
@failed=$$(cd '$(TEST_RESULTS_DIRECTORY_SQ)' && \
6772
grep -l '^failed [1-9]' *.counts | \
6873
sed -n 's/\.counts$$/.sh/p') && \
6974
test -z "$$failed" || $(MAKE) $$failed
7075

71-
prove: pre-clean check-chainlint $(TEST_LINT)
76+
prove: pre-clean $(TEST_LINT)
7277
@echo "*** prove (shell & unit tests) ***"
7378
@$(CHAINLINTSUPPRESS) TEST_OPTIONS='$(GIT_TEST_OPTS)' TEST_SHELL_PATH='$(TEST_SHELL_PATH_SQ)' $(PROVE) --exec ./run-test.sh $(GIT_PROVE_OPTS) $(T) $(UNIT_TESTS)
7479
$(MAKE) clean-except-prove-cache
@@ -132,8 +137,13 @@ check-meson:
132137
fi; \
133138
done
134139

135-
test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
140+
test-lint: test-lint-duplicates test-lint-executable \
136141
test-lint-filenames
142+
ifneq ($(PERL_PATH),)
143+
test-lint: test-lint-shell-syntax
144+
else
145+
GIT_TEST_CHAIN_LINT = 0
146+
endif
137147
ifneq ($(GIT_TEST_CHAIN_LINT),0)
138148
test-lint: test-chainlint
139149
endif

0 commit comments

Comments
 (0)