Add some additional test run output

This commit is contained in:
IamTheFij 2023-04-25 13:32:37 -07:00
parent 47f1c14c48
commit fed9224c17
2 changed files with 3 additions and 1 deletions

View File

@ -29,7 +29,7 @@ build: $(APP_NAME)
# Run all tests
.PHONY: test
test:
go test -coverprofile=coverage.out # -short
go test -v -coverprofile=coverage.out # -short
go tool cover -func=coverage.out
# Installs pre-commit hooks

View File

@ -16,6 +16,8 @@ func TestMain(m *testing.M) {
testResult := m.Run()
if testResult == 0 && testing.CoverMode() != "" {
fmt.Printf("Covermode: %s", testing.CoverMode())
c := testing.Coverage()
if c < MinCoverage {
fmt.Printf("Tests passed but coverage failed at %0.2f and minimum to pass is %0.2f\n", c, MinCoverage)