// total: (statements) 91.9%
func funcOutput(profile, outputFile string) error {
- profiles, err := cover.ParseProfiles(profile)
+ profiles, err := ParseProfiles(profile)
if err != nil {
return err
}
}
// coverage returns the fraction of the statements in the function that were covered, as a numerator and denominator.
-func (f *FuncExtent) coverage(profile *cover.Profile) (num, den int64) {
+func (f *FuncExtent) coverage(profile *Profile) (num, den int64) {
// We could avoid making this n^2 overall by doing a single scan and annotating the functions,
// but the sizes of the data structures is never very large and the scan is almost instantaneous.
var covered, total int64
// coverage report, writing it to outfile. If outfile is empty,
// it writes the report to a temporary file and opens it in a web browser.
func htmlOutput(profile, outfile string) error {
- profiles, err := cover.ParseProfiles(profile)
+ profiles, err := ParseProfiles(profile)
if err != nil {
return err
}
// percentCovered returns, as a percentage, the fraction of the statements in
// the profile covered by the test run.
// In effect, it reports the coverage of a given source file.
-func percentCovered(p *cover.Profile) float64 {
+func percentCovered(p *Profile) float64 {
var total, covered int64
for _, b := range p.Blocks {
total += int64(b.NumStmt)
// htmlGen generates an HTML coverage report with the provided filename,
// source code, and tokens, and writes it to the given Writer.
-func htmlGen(w io.Writer, src []byte, boundaries []cover.Boundary) error {
+func htmlGen(w io.Writer, src []byte, boundaries []Boundary) error {
dst := bufio.NewWriter(w)
for i := range src {
for len(boundaries) > 0 && boundaries[0].Offset == i {