]> Sergey Matveev's repositories - zsh-autoenv.git/blobdiff - Makefile
varstash: add support for exported variables in subshells
[zsh-autoenv.git] / Makefile
index db303fa3d6353efeb0f0f680c85fb28536de0504..98597759e2dc1ccb5aeda7b30615a5a27aa3e0ce 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,8 @@
-export ZDOTDIR=${PWD}/tests/ZDOTDIR
+# Default, can be overridden using "make test ZDOTDIR=...".
+ZDOTDIR:=${CURDIR}/tests/ZDOTDIR
+
+# Export it, and make it absolute.
+override export ZDOTDIR:=$(abspath $(ZDOTDIR))
 
 test:
        cram --shell=zsh -v tests
@@ -10,7 +14,8 @@ itest:
 test_full:
        for i in $(wildcard tests/ZDOTDIR*); do \
                echo "ZDOTDIR=$$i"; \
-               ZDOTDIR=${PWD}/$$i cram --shell=zsh -v tests; \
+               ZDOTDIR=${CURDIR}/$$i cram --shell=zsh -v tests; \
+               echo; \
        done
 
 # Define targets for test files, with relative and abolute path.
@@ -20,7 +25,10 @@ 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):
-       ZDOTDIR="${PWD}/tests" cram --shell=zsh -v $@
+       cram --shell=zsh -v $@
 .PHONY: $(_TESTS_REL_AND_ABS)
 
 .PHONY: itest test
+
+clean:
+       $(RM) tests/*.err