Skip to content

Commit d44ffa0

Browse files
committed
test: show code coverage numbers per function
We have added a visualization of code coverage in Coveralls, but sometimes it is convenient to show percents of covered statements locally without pushing to remote branch and running CI. Example of output: $ go tool cover -func=coverage.out github.com/tarantool/go-tarantool/auth.go:8: scramble 90.9% github.com/tarantool/go-tarantool/auth.go:36: xor 100.0% github.com/tarantool/go-tarantool/client_tools.go:13: EncodeMsgpack 100.0% github.com/tarantool/go-tarantool/client_tools.go:25: EncodeMsgpack 100.0% github.com/tarantool/go-tarantool/client_tools.go:37: EncodeMsgpack 0.0% github.com/tarantool/go-tarantool/client_tools.go:49: EncodeMsgpack 0.0% github.com/tarantool/go-tarantool/client_tools.go:63: EncodeMsgpack 0.0% github.com/tarantool/go-tarantool/client_tools.go:78: EncodeMsgpack 0.0% github.com/tarantool/go-tarantool/connection.go:67: Report 0.0% ...
1 parent 5446423 commit d44ffa0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ coverage:
6363
go clean -testcache
6464
go get golang.org/x/tools/cmd/cover
6565
go test ./... -v -p 1 -covermode=atomic -coverprofile=$(COVERAGE_FILE) -coverpkg=./...
66+
go tool cover -func=$(COVERAGE_FILE)
6667

6768
.PHONY: coveralls
6869
coveralls: coverage

0 commit comments

Comments
 (0)