Skip to content

Commit

Permalink
Makefile: improve cover target
Browse files Browse the repository at this point in the history
  • Loading branch information
charlievieth committed Jul 25, 2021
1 parent b49d597 commit 86100ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# Dependency directories (remove the comment below to include it)
/vendor

cover.html
/build
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ all: test reoncetest lint

.PHONY: cover
cover: # runs all tests against the package, generating a coverage report and opening it in the default browser
go test -race -covermode=atomic -coverprofile=cover.out ./...
go tool cover -html cover.out -o cover.html
which open && open cover.html
@mkdir -p ./build && \
go test -race -covermode=atomic -coverprofile=./build/cover.out ./... && \
go tool cover -html ./build/cover.out -o ./build/cover.html && \
which open && open ./build/cover.html

.PHONY: clean
clean:
rm -rf ./build

0 comments on commit 86100ab

Please sign in to comment.