diff --git a/test/Makefile b/test/Makefile index 93a287a3f..8974c552b 100644 --- a/test/Makefile +++ b/test/Makefile @@ -18,19 +18,21 @@ clean: bins: $(BINS) -bin/random: $(RANDOM_SRC)/**/*.go IPFS-BUILD-OPTIONS +find_go_files = $(shell find $(1) -name "*.go") + +bin/random: $(call find_go_files, $(RANDOM_SRC)) IPFS-BUILD-OPTIONS @echo "*** installing $@ ***" go build $(GOFLAGS) -o bin/random $(RANDOM_SRC)/random -bin/multihash: $(MULTIHASH_SRC)/**/*.go IPFS-BUILD-OPTIONS +bin/multihash: $(call find_go_files, $(MULTIHASH_SRC)) IPFS-BUILD-OPTIONS @echo "*** installing $@ ***" go build $(GOFLAGS) -o bin/multihash $(MULTIHASH_SRC)/multihash -bin/ipfs: $(IPFS_ROOT)/**/*.go IPFS-BUILD-OPTIONS +bin/ipfs: $(call find_go_files, $(IPFS_ROOT)) IPFS-BUILD-OPTIONS @echo "*** installing $@ ***" go build $(GOFLAGS) -o bin/ipfs $(IPFS_CMD) -bin/pollEndpoint: $(POLLENDPOINT_SRC)/*.go IPFS-BUILD-OPTIONS +bin/pollEndpoint: $(call find_go_files, $(POLLENDPOINT_SRC)) IPFS-BUILD-OPTIONS @echo "*** installing $@ ***" go build $(GOFLAGS) -o bin/pollEndpoint $(POLLENDPOINT_SRC) diff --git a/test/bin/checkflags b/test/bin/checkflags index a246a82c3..e78e54835 100755 --- a/test/bin/checkflags +++ b/test/bin/checkflags @@ -14,9 +14,11 @@ shift shift FLAG_MSGS="$@" +test -f $FLAG_FILE || touch $FLAG_FILE + # 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)" +if test x"$FLAG_VALS" != x"$(cat "$FLAG_FILE")" then echo "$FLAG_MSGS" echo "$FLAG_VALS" >"$FLAG_FILE" diff --git a/test/sharness/Makefile b/test/sharness/Makefile index 1166df6bb..bc07c0170 100644 --- a/test/sharness/Makefile +++ b/test/sharness/Makefile @@ -14,18 +14,21 @@ IPFS_ROOT = ../.. # User might want to override those on the command line GOFLAGS = -all: clean deps $(T) aggregate +all: aggregate -clean: +clean: clean-test-results @echo "*** $@ ***" - -rm -rf test-results -rm -rf bin/ipfs -$(T): +clean-test-results: + @echo "*** $@ ***" + -rm -rf test-results + +$(T): clean-test-results deps @echo "*** $@ ***" ./$@ -aggregate: +aggregate: clean-test-results $(T) @echo "*** $@ ***" lib/test-aggregate-results.sh