File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,16 @@ test_all:
5454test_all_libsqlite3 :
5555 @GOEXPERIMENT=cgocheck2 go test -tags " $( ALL_TEST_TAGS_JOINED) ,libsqlite3" -v
5656
57+ # Run tests with coverages then display in browser, if possible.
58+ .PHONY : cover
59+ cover :
60+ @./scripts/gocover.bash -tags " $( ALL_TEST_TAGS_JOINED) "
61+
62+ # Run tests with coverages then display in browser, if possible.
63+ .PHONY : cover_libsqlite3
64+ cover_libsqlite3 :
65+ @./scripts/gocover.bash -tags " $( ALL_TEST_TAGS_JOINED) ,libsqlite3"
66+
5767.PHONY : qtest
5868qtest :
5969 @GOEXPERIMENT=cgocheck2 go test -tags " libsqlite3"
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -eo pipefail
4+
5+ # run coverage tests on the current Go package
6+ function gocover() {
7+ local exit_code=0
8+ local tmpfile
9+ tmpfile=" $( mktemp -t ' gocover' ) " || return 1
10+ go test -covermode=atomic -coverprofile=" ${tmpfile} " " $@ " || {
11+ exit_code=1
12+ }
13+ go tool cover -html=" ${tmpfile} " || {
14+ rm " ${tmpfile} "
15+ exit_code=1
16+ }
17+ return $exit_code
18+ }
19+
20+ gocover " $@ "
You can’t perform that action at this time.
0 commit comments