tests: allow shell to be overridden

On some systems (e.g. Solaris), /bin/sh is not a POSIX shell.  Git
already provides suitable overrides in its config.mak.uname file and we
provide cgit.conf to allow the user to further change this.

The code for this is taken from Git's t/Makefile, meaning that we now
invoke the tests in the same way that Git does.

Signed-off-by: John Keeping <john@keeping.me.uk>
This commit is contained in:
John Keeping 2015-08-13 12:14:13 +01:00 committed by Jason A. Donenfeld
부모 c0b5982303
커밋 2ef4edee19
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제

파일 보기

@ -1,11 +1,15 @@
include ../git/config.mak.uname
-include ../cgit.conf
SHELL_PATH ?= $(SHELL)
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
all: $(T)
$(T):
@./$@ $(CGIT_TEST_OPTS)
@'$(SHELL_PATH_SQ)' $@ $(CGIT_TEST_OPTS)
clean:
$(RM) -rf trash