From 8273c8b176e9fc2cb2898b7ee76af2a8558db4ff Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 12 Aug 2026 19:26:32 -1000 Subject: Tidy the test comments and shell portability --- tests/Makefile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'tests/Makefile') diff --git a/tests/Makefile b/tests/Makefile index e159487..1047de5 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,17 +1,29 @@ +# Runs the cgit test suite. Every t[0-9][0-9][0-9][0-9]-*.sh script beside this +# file is a self-contained test built on the test library in the bundled Git +# tree, so all that is needed here is a shell to run each one under and a way +# to pass extra options along. The top-level Makefile reaches this through its +# test target, once cgit and the Git tree it links against have been built. + +# SHELL_PATH comes from Git's platform detection, and cgit.conf may override it, +# so both are read before anything below uses it. include ../vendor/git/config.mak.uname -include ../cgit.conf SHELL_PATH ?= $(SHELL) + +# Escaped for the single quotes that the recipe below puts around the path. SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) -T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh) +TESTS = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh) -all: $(T) +all: $(TESTS) -$(T): +$(TESTS): @'$(SHELL_PATH_SQ)' $@ $(CGIT_TEST_OPTS) clean: $(RM) -r 'trash directory'.* test-results -.PHONY: all $(T) clean +# Each test is named after a file that already exists, so without this make +# would decide there is nothing to do and run none of them. +.PHONY: all $(TESTS) clean -- cgit v2.8.0