diff options
| -rw-r--r-- | Magefile.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Magefile.go b/Magefile.go index c87f63a..0d52d30 100644 --- a/Magefile.go +++ b/Magefile.go @@ -257,6 +257,13 @@ func Coverage() error { return err } fmt.Println("HTML coverage report written to " + html + " (cross-package)") + total, ok := totalCoveragePercent(prof) + if !ok { + return fmt.Errorf("parse total coverage from %s", prof) + } + if total < coverageThreshold { + return fmt.Errorf("total coverage %.1f%% is below threshold %.1f%%", total, coverageThreshold) + } return nil } |
