1
0
mirror of https://github.com/golang/go synced 2024-11-18 15:04:44 -07:00

cmd/cover: try once again to fix the build

Forgot to update the references to the old cover package. No excuse.

Change-Id: If17b7521f0bf70bc0c8da9c5adf246d90f644637
Reviewed-on: https://go-review.googlesource.com/9564
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Rob Pike 2015-04-30 19:14:45 -07:00
parent e0820ac8d1
commit bc1410a4f9
3 changed files with 5 additions and 5 deletions

Binary file not shown.

View File

@ -31,7 +31,7 @@ import (
// total: (statements) 91.9%
func funcOutput(profile, outputFile string) error {
profiles, err := cover.ParseProfiles(profile)
profiles, err := ParseProfiles(profile)
if err != nil {
return err
}
@ -128,7 +128,7 @@ func (v *FuncVisitor) Visit(node ast.Node) ast.Visitor {
}
// 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

View File

@ -22,7 +22,7 @@ import (
// 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
}
@ -85,7 +85,7 @@ func htmlOutput(profile, outfile string) error {
// 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)
@ -101,7 +101,7 @@ func percentCovered(p *cover.Profile) float64 {
// 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 {