From 2e7050dbe2cdce030ed2f4189b9a904e67b352af Mon Sep 17 00:00:00 2001
From: w0rp <devw0rp@gmail.com>
Date: Wed, 15 Feb 2017 20:40:50 +0000
Subject: [PATCH] Create a make target and variable for running specific tests

---
 Makefile | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

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 '========================================'; \