Skip to content

Commit dbf91a1

Browse files
committed
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 <[email protected]>
1 parent 61550d0 commit dbf91a1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/sharness/Makefile

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ BINS = bin/random bin/multihash bin/ipfs bin/pollEndpoint
1111
SHARNESS = lib/sharness/sharness.sh
1212
IPFS_ROOT = ../..
1313

14+
# User might want to override those on the command line
15+
GOFLAGS =
16+
1417
all: clean deps $(T) aggregate
1518

1619
clean:
@@ -32,11 +35,13 @@ $(SHARNESS):
3235
@echo "*** installing $@ ***"
3336
lib/install-sharness.sh
3437

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
3843

39-
.PHONY: all clean $(T) aggregate
44+
.PHONY: all clean $(T) aggregate FORCE
4045

4146
# will fail if curl is not installed.
4247
# TODO: get rid of this and install curl with git or ipfs.

0 commit comments

Comments
 (0)