Skip to content

Commit

Permalink
build: Simplify make test and log output
Browse files Browse the repository at this point in the history
  • Loading branch information
magiconair committed Apr 27, 2017
1 parent 8fbf731 commit 9c632e4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 50 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ website/build/
website/npm-debug.log
*.old
*.attr
*.log

ui/.sass-cache
ui/static/base.css
Expand Down
21 changes: 8 additions & 13 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ GOTOOLS = \
github.com/mitchellh/gox \
golang.org/x/tools/cmd/cover \
golang.org/x/tools/cmd/stringer
TEST ?= ./...
GOTAGS ?= consul
GOFILES ?= $(shell go list $(TEST) | grep -v /vendor/)
GOFILES ?= $(shell go list ./... | grep -v /vendor/)
GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH)

Expand Down Expand Up @@ -38,27 +37,23 @@ dist:
@GOTAGS='$(GOTAGS)' sh -c "'$(CURDIR)/scripts/dist.sh'"

cov:
gocov test ${GOFILES} | gocov-html > /tmp/coverage.html
gocov test $(GOFILES) | gocov-html > /tmp/coverage.html
open /tmp/coverage.html

test:
@./scripts/verify_no_uuid.sh
@env \
GOTAGS="${GOTAGS}" \
GOFILES="${GOFILES}" \
TESTARGS="${TESTARGS}" \
sh -c "'$(CURDIR)/scripts/test.sh'"
test: dev
go test -tags "$(GOTAGS)" -i -run '^$$' ./...
go test -tags "$(GOTAGS)" -v $(GOFILES) | tee test.log 2>&1

cover:
go test ${GOFILES} --cover
go test $(GOFILES) --cover

format:
@echo "--> Running go fmt"
@go fmt ${GOFILES}
@go fmt $(GOFILES)

vet:
@echo "--> Running go vet"
@go vet ${GOFILES}; if [ $$? -eq 1 ]; then \
@go vet $(GOFILES); if [ $$? -eq 1 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
Expand Down
24 changes: 0 additions & 24 deletions scripts/test.sh

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/verify_no_uuid.sh

This file was deleted.

0 comments on commit 9c632e4

Please sign in to comment.