Browse Source

Merge pull request #534 from aboch/t

Make integration-tests an indipendent target
Madhu Venugopal 9 năm trước cách đây
mục cha
commit
987aab8f3e
1 tập tin đã thay đổi với 12 bổ sung3 xóa
  1. 12 3
      libnetwork/Makefile

+ 12 - 3
libnetwork/Makefile

@@ -1,4 +1,4 @@
-.PHONY: all all-local build build-local check check-code check-format run-tests check-local integration-tests install-deps coveralls circle-ci start-services
+.PHONY: all all-local build build-local check check-code check-format run-tests check-local integration-tests install-deps coveralls circle-ci start-services clean
 SHELL=/bin/bash
 SHELL=/bin/bash
 build_image=libnetwork-build
 build_image=libnetwork-build
 dockerargs = --privileged -v $(shell pwd):/go/src/github.com/docker/libnetwork -w /go/src/github.com/docker/libnetwork
 dockerargs = --privileged -v $(shell pwd):/go/src/github.com/docker/libnetwork -w /go/src/github.com/docker/libnetwork
@@ -7,9 +7,9 @@ docker = docker run --rm -it ${dockerargs} ${container_env} ${build_image}
 ciargs = -e "COVERALLS_TOKEN=$$COVERALLS_TOKEN" -e "INSIDECONTAINER=-incontainer=true"
 ciargs = -e "COVERALLS_TOKEN=$$COVERALLS_TOKEN" -e "INSIDECONTAINER=-incontainer=true"
 cidocker = docker run ${ciargs} ${dockerargs} golang:1.4
 cidocker = docker run ${ciargs} ${dockerargs} golang:1.4
 
 
-all: ${build_image}.created build check integration-tests
+all: ${build_image}.created build check integration-tests clean
 
 
-integration-tests:
+integration-tests: ./cmd/dnet/dnet
 	@if [ ! -d ./integration-tmp ]; then \
 	@if [ ! -d ./integration-tmp ]; then \
 	    mkdir -p ./integration-tmp;	\
 	    mkdir -p ./integration-tmp;	\
 	    git clone https://github.com/sstephenson/bats.git ./integration-tmp/bats; \
 	    git clone https://github.com/sstephenson/bats.git ./integration-tmp/bats; \
@@ -17,6 +17,15 @@ integration-tests:
 	fi
 	fi
 	@./integration-tmp/bin/bats ./test/integration/dnet
 	@./integration-tmp/bin/bats ./test/integration/dnet
 
 
+./cmd/dnet/dnet:
+	make build-local
+
+clean:
+	@if [ -e ./cmd/dnet/dnet ]; then \
+		echo "Removing dnet binary"; \
+		rm -rf ./cmd/dnet/dnet; \
+	fi
+
 all-local: check-local build-local
 all-local: check-local build-local
 
 
 ${build_image}.created:
 ${build_image}.created: