pckg

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package pckg contains high level representations of package coverage statistics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group []*Stats

Group is a slice of package stats.

func (*Group) CoveragePercent

func (g *Group) CoveragePercent() (coveragePercent float64)

CoveragePercent calculates the coverage percentage across all packages.

func (*Group) EstimateCount

func (g *Group) EstimateCount() (estimatedCount float64)

EstimateCount returns the number of packages who have had their coverage percentages estimated.

func (*Group) MedianStatementCount

func (g *Group) MedianStatementCount() float64

MedianStatementCount calculates the median number of statements in packages that currently have associated tests.

func (*Group) SetEstimatedStmtCountFrom

func (g *Group) SetEstimatedStmtCountFrom(reference Group)

SetEstimatedStmtCountFrom sets the estimated statement count based on the average number of statements in other packages in the group.

func (*Group) StatementCounts

func (g *Group) StatementCounts() (statementCounts []float64)

StatementCounts returns a list of statement counts from the group.

func (*Group) TotalCovered

func (g *Group) TotalCovered() float64

TotalCovered returns the total number of statements that have been covered by unit tests.

func (*Group) TotalStatementCount

func (g *Group) TotalStatementCount() float64

TotalStatementCount returns the sum of statements across all packaes that currently have associated tests.

func (*Group) TotalUncovered

func (g *Group) TotalUncovered() float64

TotalUncovered returns the total number of statements that have not been covered by unit tests.

type Stats

type Stats struct {
	Package         string
	Statements      float64
	Covered         float64
	Uncovered       float64
	Estimated       bool
	RawCoverageData []string
}

Stats represent statistics for one or more packages.

func (*Stats) CoveragePercent

func (s *Stats) CoveragePercent() (coveragePercent float64)

CoveragePercent calculates the coverage percentage for the package stats.

Source Files

  • doc.go
  • group.go
  • stats.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL