summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-02-15 20:40:50 +0000
committerw0rp <devw0rp@gmail.com>2017-02-15 20:40:50 +0000
commit2e7050dbe2cdce030ed2f4189b9a904e67b352af (patch)
tree946e258529d1e0359a263bcdb59cba9a8385e77e /Makefile
parent721a850e21e31b4abfebff00d4bb43bfefcdabe4 (diff)
downloadale-2e7050dbe2cdce030ed2f4189b9a904e67b352af.zip
Create a make target and variable for running specific tests
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index a8c1da4d..5e939c1e 100644
--- a/Makefile
+++ b/Makefile
@@ -2,11 +2,20 @@ SHELL := /usr/bin/env bash
IMAGE ?= w0rp/ale
CURRENT_IMAGE_ID = 107e4efc4267
DOCKER_FLAGS = --rm -v $(PWD):/testplugin -v $(PWD)/test:/home "$(IMAGE)"
+tests = test/*
test-setup:
docker images -q w0rp/ale | grep ^$(CURRENT_IMAGE_ID) > /dev/null || \
docker pull $(IMAGE)
+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
+
test: test-setup
@:; \
vims=$$(docker run --rm $(IMAGE) ls /vim-build/bin | grep -E '^n?vim'); \
@@ -18,7 +27,7 @@ test: test-setup
echo "Running tests for $$vim"; \
echo '========================================'; \
echo; \
- docker run -a stderr $(DOCKER_FLAGS) $$vim '+Vader! test/*' || EXIT=$$?; \
+ docker run -a stderr $(DOCKER_FLAGS) $$vim '+Vader! $(tests)' || EXIT=$$?; \
done; \
echo; \
echo '========================================'; \