From dbf91a19a1e5a87d36c93fc2f8df7374dd42dfe1 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sat, 4 Apr 2015 12:50:29 +0200 Subject: [PATCH] test/sharness: add GOFLAGS variable and race target The GOFLAGS variable makes it possible to run all sharness tests with go binaries built with some special flags. The "race" target makes it easy run the sharness tests with go binaries built with the -race flag. License: MIT Signed-off-by: Christian Couder --- test/sharness/Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/sharness/Makefile b/test/sharness/Makefile index 144262f98..1166df6bb 100644 --- a/test/sharness/Makefile +++ b/test/sharness/Makefile @@ -11,6 +11,9 @@ BINS = bin/random bin/multihash bin/ipfs bin/pollEndpoint SHARNESS = lib/sharness/sharness.sh IPFS_ROOT = ../.. +# User might want to override those on the command line +GOFLAGS = + all: clean deps $(T) aggregate clean: @@ -32,11 +35,13 @@ $(SHARNESS): @echo "*** installing $@ ***" lib/install-sharness.sh -bin/%: $(IPFS_ROOT)/**/*.go - @echo "*** installing $@ ***" - cd .. && make $@ +bin/%: FORCE + cd .. && make GOFLAGS=$(GOFLAGS) $@ -.PHONY: all clean $(T) aggregate +race: + make GOFLAGS=-race all + +.PHONY: all clean $(T) aggregate FORCE # will fail if curl is not installed. # TODO: get rid of this and install curl with git or ipfs.