From 6e05c420c9b7e4660b391643be21720d6f80e18d Mon Sep 17 00:00:00 2001 From: Victor Marmol Date: Tue, 29 Apr 2014 20:03:33 +0000 Subject: [PATCH] Add a TESTDIRS variable to the test bundle to allow for the running of a single go directory worth of tests. Docker-DCO-1.1-Signed-off-by: Victor Marmol (github: vmarmol) --- Makefile | 2 +- hack/make/test | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e020c14eac..5945dc2737 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ DOCKER_IMAGE := docker$(if $(GIT_BRANCH),:$(GIT_BRANCH)) DOCKER_DOCS_IMAGE := docker-docs$(if $(GIT_BRANCH),:$(GIT_BRANCH)) DOCKER_MOUNT := $(if $(BINDDIR),-v "$(CURDIR)/$(BINDDIR):/go/src/github.com/dotcloud/docker/$(BINDDIR)") -DOCKER_RUN_DOCKER := docker run --rm -it --privileged -e TESTFLAGS -e DOCKER_GRAPHDRIVER -e DOCKER_EXECDRIVER $(DOCKER_MOUNT) "$(DOCKER_IMAGE)" +DOCKER_RUN_DOCKER := docker run --rm -it --privileged -e TESTFLAGS -e TESTDIRS -e DOCKER_GRAPHDRIVER -e DOCKER_EXECDRIVER $(DOCKER_MOUNT) "$(DOCKER_IMAGE)" # to allow `make DOCSDIR=docs docs-shell` DOCKER_RUN_DOCS := docker run --rm -it $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR)) -e AWS_S3_BUCKET diff --git a/hack/make/test b/hack/make/test index 183ce95c24..828fdf6efd 100644 --- a/hack/make/test +++ b/hack/make/test @@ -17,8 +17,13 @@ bundle_test() { { date + # Run all the tests if no TESTDIRS were specified. + if [ -z "$TESTDIRS" ]; then + TESTDIRS=$(find_dirs '*_test.go') + fi + TESTS_FAILED=() - for test_dir in $(find_dirs '*_test.go'); do + for test_dir in $TESTDIRS; do echo if ! LDFLAGS="$LDFLAGS $LDFLAGS_STATIC_DOCKER" go_test_dir "$test_dir"; then