Skip to content

Commit

Permalink
crit: run unit tests with coverage results
Browse files Browse the repository at this point in the history
There are two ways we can enable test coverage for the unit tests:
1) `-coverprofile` and 2) `-cover`. The first method stores the results
in a file that we can upload with `codecov`. The second method only
outputs the test coverage results to standard output.

This patch set the default value of GOFLAGS to `-cover` to
always show the coverage of unit tests.

Suggested-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
  • Loading branch information
rst0git committed Apr 16, 2023
1 parent 53fe990 commit 16326e8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ test-imgs: ../test/loop/loop
pkill -9 loop

unit-test: test-imgs
$(eval GOFLAGS ?= -cover)
go test ${GOFLAGS} -v ./...

clean:
Expand Down

0 comments on commit 16326e8

Please sign in to comment.