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 <chriscool@tuxfamily.org>
Christian Couder committed
Apr 4, 2015 at 12:50 UTC
dbf91a19a1e5a87d36c93fc2f8df7374dd42dfe1
1 file changed
+9
-4
test/sharness/Makefile
+9
-4
@@ -11,6 +11,9 @@ BINS = bin/random bin/multihash bin/ipfs bin/pollEndpoint
11
SHARNESS = lib/sharness/sharness.sh
12
IPFS_ROOT = ../..
13
14
+# User might want to override those on the command line
15
+GOFLAGS =
16
+
17
all: clean deps $(T) aggregate
18
19
clean:
@@ -32,11 +35,13 @@ $(SHARNESS):
35
@echo "*** installing $@ ***"
36
lib/install-sharness.sh
37
35
-bin/%: $(IPFS_ROOT)/**/*.go
36
- @echo "*** installing $@ ***"
37
- cd .. && make $@
38
+bin/%: FORCE
39
+ cd .. && make GOFLAGS=$(GOFLAGS) $@
40
+
41
+race:
42
+ make GOFLAGS=-race all
43
39
-.PHONY: all clean $(T) aggregate
44
+.PHONY: all clean $(T) aggregate FORCE
45
46
# will fail if curl is not installed.
47
# TODO: get rid of this and install curl with git or ipfs.