]> Sergey Matveev's repositories - zsh-autoenv.git/blob - Makefile
tests: mv ZDOTDIR.{clobber,options}
[zsh-autoenv.git] / Makefile
1 # Empty by default, can be overridden using "make test ZDOTDIR=…".
2 ZDOTDIR:=
3 # Make it absolute.
4 override ZDOTDIR:=$(abspath $(ZDOTDIR))
5
6 TEST_SHELL:=zsh
7
8 test:
9         ZDOTDIR=$(ZDOTDIR) cram --shell=$(TEST_SHELL) -v tests
10
11 itest:
12         ZDOTDIR=$(ZDOTDIR) cram -i --shell=$(TEST_SHELL) tests
13
14 # Run tests with all ZDOTDIRs.
15 test_full:
16         @ret=0; \
17         for i in $(wildcard tests/ZDOTDIR*); do \
18           echo "TEST_SHELL=$(TEST_SHELL) ZDOTDIR=$$i"; \
19           ZDOTDIR=${CURDIR}/$$i cram --shell=$(TEST_SHELL) -v tests || ret=$$?; \
20           echo; \
21         done; \
22         exit $$ret
23
24 # Define targets for test files, with relative and abolute path.
25 # Use verbose output, which is useful with Vim's 'errorformat'.
26 TESTS:=$(wildcard tests/*.t)
27
28 uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
29 _TESTS_REL_AND_ABS:=$(call uniq,$(abspath $(TESTS)) $(TESTS))
30 $(_TESTS_REL_AND_ABS):
31         cram --shell=$(TEST_SHELL) -v $@
32 .PHONY: $(_TESTS_REL_AND_ABS)
33
34 .PHONY: itest test
35
36 clean:
37         $(RM) tests/*.err