]> Sergey Matveev's repositories - zsh-autoenv.git/blobdiff - Makefile
tests: cleanup test_full (#86)
[zsh-autoenv.git] / Makefile
index ed90a571ed796dcf1896aca58255c9975516bbc6..f398f888402c2b8a144aba1eda33a02e64c5e722 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,25 @@
 # Default, can be overridden using "make test ZDOTDIR=...".
 ZDOTDIR:=${CURDIR}/tests/ZDOTDIR
+# Make it absolute.
+override ZDOTDIR:=$(abspath $(ZDOTDIR))
 
-# Export it, and make it absolute.
-override export ZDOTDIR:=$(abspath $(ZDOTDIR))
+TEST_SHELL:=zsh
 
 test:
-       cram --shell=zsh -v tests
+       ZDOTDIR=$(ZDOTDIR) cram --shell=$(TEST_SHELL) -v tests
 
 itest:
-       cram -i --shell=zsh tests
+       ZDOTDIR=$(ZDOTDIR) cram -i --shell=$(TEST_SHELL) tests
 
 # Run tests with all ZDOTDIRs.
 test_full:
-       ret=0; \
+       @ret=0; \
        for i in $(wildcard tests/ZDOTDIR*); do \
-               echo "ZDOTDIR=$$i"; \
-               ZDOTDIR=${CURDIR}/$$i cram --shell=zsh -v tests || ret=$$?; \
-               echo; \
+         echo "TEST_SHELL=$(TEST_SHELL) ZDOTDIR=$$i"; \
+         ZDOTDIR=${CURDIR}/$$i cram --shell=$(TEST_SHELL) -v tests || ret=$$?; \
+         echo; \
        done; \
-       return $$ret
+       exit $$ret
 
 # Define targets for test files, with relative and abolute path.
 # Use verbose output, which is useful with Vim's 'errorformat'.
@@ -27,7 +28,7 @@ TESTS:=$(wildcard tests/*.t)
 uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
 _TESTS_REL_AND_ABS:=$(call uniq,$(abspath $(TESTS)) $(TESTS))
 $(_TESTS_REL_AND_ABS):
-       cram --shell=zsh -v $@
+       cram --shell=$(TEST_SHELL) -v $@
 .PHONY: $(_TESTS_REL_AND_ABS)
 
 .PHONY: itest test