Skip to content

Commit

Permalink
Updated Makefile
Browse files Browse the repository at this point in the history
Added -race and -cover flag to go testing and seperated go fmt, go vet and go test into seperated makefile targets.

Added a new Makefile target 'webtest' that opens the cover profile in your default browser.
  • Loading branch information
leonsteinhaeuser committed Jul 29, 2020
1 parent 725e230 commit 12faf11
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
all: test build

test:
vet:
go vet ./...
go test ./...

fmt:
go fmt ./...

test: fmt vet
go test -race -cover ./...

webtest:
go test -coverprofile=output.out
go tool cover -html=output.out

apitest:
./apitest --stop-on-fail -d test/
Expand All @@ -12,7 +21,7 @@ gox:
gox ${LDFLAGS} -parallel=4 -output="./bin/apitest_{{.OS}}_{{.Arch}}"

clean:
rm -rfv ./apitest ./bin/*
rm -rfv ./apitest ./bin/* ./output.out

build:
go build
Expand Down

0 comments on commit 12faf11

Please sign in to comment.