@ -50,16 +50,20 @@ cov:
open /tmp/coverage.html
open /tmp/coverage.html
test : dev
test : dev
go test -tags " $( GOTAGS) " -i ./...
go test -tags '$(GOTAGS)' -i ./...
go test -tags " $( GOTAGS) " -run '^$$' ./... > /dev/null
go test $( GOTEST_FLAGS) -tags '$(GOTAGS)' -timeout 7m -v ./... 2>& 1 >test$( GOTEST_FLAGS) .log ; echo $$ ? > exit-code
go test -tags " $( GOTAGS) " -v $$ ( go list ./... | egrep -v '(agent/consul|vendor)' ) > test.log 2>& 1 || echo 'FAIL_TOKEN' >> test.log
@echo "Exit code: `cat exit-code`" >> test$( GOTEST_FLAGS) .log
go test -tags " $( GOTAGS) " -v $$ ( go list ./... | egrep '(agent/consul)' ) >> test.log 2>& 1 || echo 'FAIL_TOKEN' >> test.log
@echo "----"
@if [ " $$ TRAVIS " = = "true" ] ; then cat test.log ; fi
@grep -A5 'DATA RACE' test.log || true
@if grep -q 'FAIL_TOKEN' test.log ; then grep 'FAIL:' test.log ; exit 1 ; else echo 'PASS' ; fi
@grep -A10 'panic: test timed out' test.log || true
@grep '^PASS' test.log | uniq || true
test-race : dev
@grep -A1 -- '--- FAIL:' test.log || true
go test -tags " $( GOTAGS) " -i -run '^$$' ./...
@grep '^FAIL' test.log || true
( set -o pipefail ; go test -race -tags " $( GOTAGS) " -v ./... 2>& 1 | tee test-race.log )
@test " $$ TRAVIS " = = "true" && cat test.log || true
@exit $$ ( cat exit-code)
test-race :
$( MAKE) GOTEST_FLAGS = -race
cover :
cover :
go test $( GOFILES) --cover
go test $( GOFILES) --cover