]> Sergey Matveev's repositories - zsh-autoenv.git/blob - Makefile
Travis: actually use different ZDOTDIRs (#83)
[zsh-autoenv.git] / Makefile
1 # Default, can be overridden using "make test ZDOTDIR=...".
2 ZDOTDIR:=${CURDIR}/tests/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         for zsh in zsh /opt/zsh-4.3.9/bin/zsh; do \
17                 command -v $$zsh || { echo "Skipping non-existing shell: $$zsh"; continue; }; \
18                 ret=0; \
19                 for i in $(wildcard tests/ZDOTDIR*); do \
20                         echo "zsh=$zsh ZDOTDIR=$$i"; \
21                         SHELL=$$zsh ZDOTDIR=${CURDIR}/$$i cram --shell=$$zsh -v tests || ret=$$?; \
22                         echo; \
23                 done; \
24         done; \
25         exit $$ret
26
27 # Define targets for test files, with relative and abolute path.
28 # Use verbose output, which is useful with Vim's 'errorformat'.
29 TESTS:=$(wildcard tests/*.t)
30
31 uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
32 _TESTS_REL_AND_ABS:=$(call uniq,$(abspath $(TESTS)) $(TESTS))
33 $(_TESTS_REL_AND_ABS):
34         cram --shell=$(TEST_SHELL) -v $@
35 .PHONY: $(_TESTS_REL_AND_ABS)
36
37 .PHONY: itest test
38
39 clean:
40         $(RM) tests/*.err