]> git.cameronkatri.com Git - cgit.git/commitdiff
tests: allow shell to be overridden
authorJohn Keeping <john@keeping.me.uk>
Thu, 13 Aug 2015 11:14:13 +0000 (12:14 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 13 Aug 2015 13:36:18 +0000 (15:36 +0200)
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>
tests/Makefile

index 1556475cbb22f0f71b483f0f573fab36a06efd51..65e111733803b2049e011ac44ff8dae15eeeba17 100644 (file)
@@ -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