Browse Source

Makes test target fail based on return code from go test.

pull/3103/head
James Phillips 8 years ago
parent
commit
e9ee136baf
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
  1. 6
      GNUmakefile

6
GNUmakefile

@ -48,10 +48,10 @@ cov:
test: dev
go test -tags "$(GOTAGS)" -i -run '^$$' ./...
go test -tags "$(GOTAGS)" -v $$(go list ./... | egrep -v '(consul/consul|vendor)') > test.log 2>&1 || true
go test -tags "$(GOTAGS)" -v github.com/hashicorp/consul/consul >> test.log 2>&1 || true
go test -tags "$(GOTAGS)" -v $$(go list ./... | egrep -v '(consul/consul|vendor)') > test.log 2>&1 || echo 'FAIL_TOKEN' >> test.log
go test -tags "$(GOTAGS)" -v $$(go list ./... | egrep '(consul/consul)') >> test.log 2>&1 || echo 'FAIL_TOKEN' >> test.log
@if [ "$$TRAVIS" == "true" ] ; then cat test.log ; fi
@if grep -q 'FAIL:' test.log ; then grep 'FAIL:' test.log ; exit 1 ; else echo 'PASS' ; fi
@if grep -q 'FAIL_TOKEN' test.log ; then grep 'FAIL:' test.log ; exit 1 ; else echo 'PASS' ; fi
test-race: dev
go test -tags "$(GOTAGS)" -i -run '^$$' ./...

Loading…
Cancel
Save