2016-10-22 09:20:05 -04:00
|
|
|
SHELL := /usr/bin/env bash
|
2016-10-10 22:28:25 -04:00
|
|
|
IMAGE ?= w0rp/ale
|
2016-10-18 07:48:45 -04:00
|
|
|
CURRENT_IMAGE_ID = 107e4efc4267
|
2016-10-12 18:55:09 -04:00
|
|
|
DOCKER_FLAGS = --rm -v $(PWD):/testplugin -v $(PWD)/test:/home "$(IMAGE)"
|
2017-02-15 15:40:50 -05:00
|
|
|
tests = test/*
|
2016-10-10 22:28:25 -04:00
|
|
|
|
|
|
|
test-setup:
|
2016-10-19 17:21:00 -04:00
|
|
|
docker images -q w0rp/ale | grep ^$(CURRENT_IMAGE_ID) > /dev/null || \
|
|
|
|
docker pull $(IMAGE)
|
2016-10-10 22:28:25 -04:00
|
|
|
|
2017-02-15 15:40:50 -05:00
|
|
|
vader: 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; \
|
|
|
|
for vim in $$vims; do \
|
|
|
|
docker run -a stderr $(DOCKER_FLAGS) $$vim '+Vader! $(tests)'; \
|
|
|
|
done
|
|
|
|
|
2016-10-10 22:28:25 -04:00
|
|
|
test: test-setup
|
2016-10-12 18:55:09 -04:00
|
|
|
@:; \
|
2016-10-10 22:28:25 -04: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 07:25:53 -04:00
|
|
|
EXIT=0; \
|
2016-10-10 22:28:25 -04:00
|
|
|
for vim in $$vims; do \
|
2016-10-12 18:55:09 -04:00
|
|
|
echo; \
|
|
|
|
echo '========================================'; \
|
|
|
|
echo "Running tests for $$vim"; \
|
|
|
|
echo '========================================'; \
|
|
|
|
echo; \
|
2017-02-15 15:40:50 -05:00
|
|
|
docker run -a stderr $(DOCKER_FLAGS) $$vim '+Vader! $(tests)' || EXIT=$$?; \
|
2016-10-12 07:25:53 -04:00
|
|
|
done; \
|
2016-10-12 18:55:09 -04:00
|
|
|
echo; \
|
|
|
|
echo '========================================'; \
|
|
|
|
echo 'Running Vint to lint our code'; \
|
|
|
|
echo '========================================'; \
|
|
|
|
echo 'Vint warnings/errors follow:'; \
|
|
|
|
echo; \
|
2016-10-22 09:20:05 -04:00
|
|
|
set -o pipefail; \
|
2016-10-12 18:55:09 -04:00
|
|
|
docker run -a stdout $(DOCKER_FLAGS) vint -s /testplugin | sed s:^/testplugin/:: || EXIT=$$?; \
|
2016-10-22 09:20:05 -04:00
|
|
|
set +o pipefail; \
|
2016-10-12 18:55:09 -04:00
|
|
|
echo; \
|
2017-01-22 09:54:57 -05:00
|
|
|
echo '========================================'; \
|
|
|
|
echo 'Running custom checks'; \
|
|
|
|
echo '========================================'; \
|
|
|
|
echo 'Custom warnings/errors follow:'; \
|
|
|
|
echo; \
|
|
|
|
set -o pipefail; \
|
|
|
|
docker run -a stdout $(DOCKER_FLAGS) /testplugin/custom-checks /testplugin | sed s:^/testplugin/:: || EXIT=$$?; \
|
|
|
|
set +o pipefail; \
|
2016-10-12 18:55:09 -04:00
|
|
|
echo; \
|
2016-10-12 07:25:53 -04:00
|
|
|
exit $$EXIT;
|
2016-10-10 22:28:25 -04:00
|
|
|
|
2016-10-12 18:55:09 -04:00
|
|
|
.DEFAULT_GOAL := test
|