summaryrefslogtreecommitdiff
path: root/Makefile
blob: e8376debb4c260f644a8aa641644e22440957920 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
IMAGE ?= w0rp/ale
DOCKER_FLAGS = --rm -v $(PWD):/testplugin -v $(PWD)/test:/home "$(IMAGE)"

test-setup:
	docker images -q $(IMAGE) || docker pull $(IMAGE)

test: test-setup
	@:; \
	vims=$$(docker run --rm $(IMAGE) ls /vim-build/bin | grep -E '^n?vim'); \
	if [ -z "$$vims" ]; then echo "No Vims found!"; exit 1; fi; \
	EXIT=0; \
	for vim in $$vims; do \
		echo; \
		echo '========================================'; \
		echo "Running tests for $$vim"; \
		echo '========================================'; \
		echo; \
		docker run -a stderr $(DOCKER_FLAGS) $$vim '+Vader! test/*' || EXIT=$$?; \
	done; \
	echo; \
	echo '========================================'; \
	echo 'Running Vint to lint our code'; \
	echo '========================================'; \
	echo 'Vint warnings/errors follow:'; \
	echo; \
	docker run -a stdout $(DOCKER_FLAGS) vint -s /testplugin | sed s:^/testplugin/:: || EXIT=$$?; \
	echo; \
	echo; \
	exit $$EXIT;

.DEFAULT_GOAL := test