提交 f2aba08c 作者: Juan Batiz-Benet

Merge pull request #1024 from ipfs/run_tests_with_race_flag2

Run tests with race flag using checkflags script
bin/ipfs IPFS-BUILD-OPTIONS
bin/random
...@@ -6,6 +6,9 @@ RANDOM_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random ...@@ -6,6 +6,9 @@ RANDOM_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random
MULTIHASH_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-multihash MULTIHASH_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-multihash
POLLENDPOINT_SRC= ../thirdparty/pollEndpoint POLLENDPOINT_SRC= ../thirdparty/pollEndpoint
# User might want to override those on the command line
GOFLAGS =
all: deps all: deps
deps: bins deps: bins
...@@ -15,17 +18,21 @@ clean: ...@@ -15,17 +18,21 @@ clean:
bins: $(BINS) bins: $(BINS)
bin/random: $(RANDOM_SRC)/**/*.go bin/random: $(RANDOM_SRC)/**/*.go IPFS-BUILD-OPTIONS
go build -o bin/random $(RANDOM_SRC)/random @echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/random $(RANDOM_SRC)/random
bin/multihash: $(MULTIHASH_SRC)/**/*.go bin/multihash: $(MULTIHASH_SRC)/**/*.go IPFS-BUILD-OPTIONS
go build -o bin/multihash $(MULTIHASH_SRC)/multihash @echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/multihash $(MULTIHASH_SRC)/multihash
bin/ipfs: $(IPFS_ROOT)/**/*.go bin/ipfs: $(IPFS_ROOT)/**/*.go IPFS-BUILD-OPTIONS
go build -o bin/ipfs $(IPFS_CMD) @echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/ipfs $(IPFS_CMD)
bin/pollEndpoint: $(POLLENDPOINT_SRC)/*.go bin/pollEndpoint: $(POLLENDPOINT_SRC)/*.go IPFS-BUILD-OPTIONS
go build -o bin/pollEndpoint $(POLLENDPOINT_SRC) @echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/pollEndpoint $(POLLENDPOINT_SRC)
test: test_expensive test: test_expensive
...@@ -38,4 +45,12 @@ test_cheap: ...@@ -38,4 +45,12 @@ test_cheap:
cd sharness && make cd sharness && make
cd 3nodetest && make cd 3nodetest && make
.PHONY: all clean test_race:
cd sharness && make GOFLAGS=-race TEST_EXPENSIVE=1
cd 3nodetest && make GOFLAGS=-race
cd dependencies && make GOFLAGS=-race
IPFS-BUILD-OPTIONS: FORCE
@bin/checkflags '$@' '$(GOFLAGS)' '*** new Go flags ***'
.PHONY: all clean FORCE
#!/bin/sh
# Author: Christian Couder <chriscool@tuxfamily.org>
# MIT LICENSED
if test "$#" -lt 3
then
echo >&2 "usage $0 FILE VALUES MSG..."
exit 1
fi
FLAG_FILE="$1"
FLAG_VALS="$2"
shift
shift
FLAG_MSGS="$@"
# Use x in front of tested values as flags could be
# interpreted by "test" to be for itself.
if test x"$FLAG_VALS" != x"$(cat "$FLAG_FILE" 2>/dev/null)"
then
echo "$FLAG_MSGS"
echo "$FLAG_VALS" >"$FLAG_FILE"
fi
...@@ -11,6 +11,9 @@ BINS = bin/random bin/multihash bin/ipfs bin/pollEndpoint ...@@ -11,6 +11,9 @@ BINS = bin/random bin/multihash bin/ipfs bin/pollEndpoint
SHARNESS = lib/sharness/sharness.sh SHARNESS = lib/sharness/sharness.sh
IPFS_ROOT = ../.. IPFS_ROOT = ../..
# User might want to override those on the command line
GOFLAGS =
all: clean deps $(T) aggregate all: clean deps $(T) aggregate
clean: clean:
...@@ -32,11 +35,13 @@ $(SHARNESS): ...@@ -32,11 +35,13 @@ $(SHARNESS):
@echo "*** installing $@ ***" @echo "*** installing $@ ***"
lib/install-sharness.sh lib/install-sharness.sh
bin/%: $(IPFS_ROOT)/**/*.go bin/%: FORCE
@echo "*** installing $@ ***" cd .. && make GOFLAGS=$(GOFLAGS) $@
cd .. && make $@
race:
make GOFLAGS=-race all
.PHONY: all clean $(T) aggregate .PHONY: all clean $(T) aggregate FORCE
# will fail if curl is not installed. # will fail if curl is not installed.
# TODO: get rid of this and install curl with git or ipfs. # TODO: get rid of this and install curl with git or ipfs.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论