2016-10-11 02:28:25 +00:00
|
|
|
IMAGE ?= w0rp/ale
|
2016-10-12 22:55:09 +00:00
|
|
|
DOCKER_FLAGS = --rm -v $(PWD):/testplugin -v $(PWD)/test:/home "$(IMAGE)"
|
2016-10-11 02:28:25 +00:00
|
|
|
|
|
|
|
test-setup:
|
|
|
|
docker images -q $(IMAGE) || docker pull $(IMAGE)
|
|
|
|
|
|
|
|
test: test-setup
|
2016-10-12 22:55:09 +00:00
|
|
|
@:; \
|
2016-10-11 02:28:25 +00:00
|
|
|
vims=$$(docker run --rm $(IMAGE) ls /vim-build/bin | grep -E '^n?vim'); \
|
|
|
|
if [ -z "$$vims" ]; then echo "No Vims found!"; exit 1; fi; \
|
2016-10-12 11:25:53 +00:00
|
|
|
EXIT=0; \
|
2016-10-11 02:28:25 +00:00
|
|
|
for vim in $$vims; do \
|
2016-10-12 22:55:09 +00:00
|
|
|
echo; \
|
|
|
|
echo '========================================'; \
|
|
|
|
echo "Running tests for $$vim"; \
|
|
|
|
echo '========================================'; \
|
|
|
|
echo; \
|
|
|
|
docker run -a stderr $(DOCKER_FLAGS) $$vim '+Vader! test/*' || EXIT=$$?; \
|
2016-10-12 11:25:53 +00:00
|
|
|
done; \
|
2016-10-12 22:55:09 +00:00
|
|
|
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; \
|
2016-10-12 11:25:53 +00:00
|
|
|
exit $$EXIT;
|
2016-10-11 02:28:25 +00:00
|
|
|
|
2016-10-12 22:55:09 +00:00
|
|
|
.DEFAULT_GOAL := test
|