github.com/keltia/go-ipfs@v0.3.8-0.20150909044612-210793031c63/test/sharness/Makefile (about) 1 # Run tests 2 # 3 # Copyright (c) 2014 Christian Couder 4 # MIT Licensed; see the LICENSE file in this repository. 5 # 6 7 # NOTE: run with TEST_VERBOSE=1 for verbose sharness tests. 8 9 T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)) 10 BINS = bin/random bin/multihash bin/ipfs bin/pollEndpoint \ 11 bin/iptb bin/go-sleep bin/random-files 12 SHARNESS = lib/sharness/sharness.sh 13 IPFS_ROOT = ../.. 14 15 # User might want to override those on the command line 16 GOFLAGS = 17 18 all: aggregate 19 20 clean: clean-test-results 21 @echo "*** $@ ***" 22 -rm -rf bin/ipfs 23 24 clean-test-results: 25 @echo "*** $@ ***" 26 -rm -rf test-results 27 28 $(T): clean-test-results deps 29 @echo "*** $@ ***" 30 ./$@ 31 32 aggregate: clean-test-results $(T) 33 @echo "*** $@ ***" 34 lib/test-aggregate-results.sh 35 36 deps: $(SHARNESS) $(BINS) curl 37 38 $(SHARNESS): FORCE 39 @echo "*** checking $@ ***" 40 lib/install-sharness.sh 41 42 bin/%: FORCE 43 cd .. && make GOFLAGS=$(GOFLAGS) $@ 44 45 race: 46 make GOFLAGS=-race all 47 48 .PHONY: all clean $(T) aggregate FORCE 49 50 # will fail if curl is not installed. 51 # TODO: get rid of this and install curl with git or ipfs. 52 install_curl_pls = "curl is required to run tests. please install it" 53 curl: 54 @which curl >/dev/null || (echo "$(install_curl_pls)" && false)