forked from sguiheux/go-coverage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
38 lines (33 loc) · 1.16 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package coverage
// Parser represents the lcov parser
type Parser struct {
path string
mode CoverageMode
}
//Report represents the result of LcovParser.parse
type Report struct {
Files []FileReport `json:"files"`
TotalLines int `json:"total_lines"`
CoveredLines int `json:"covered_lines"`
TotalFunctions int `json:"total_functions"`
CoveredFunctions int `json:"covered_functions"`
TotalBranches int `json:"total_branches"`
CoveredBranches int `json:"covered_branches"`
}
// FileReport contains all informations about a file
type FileReport struct {
Path string `json:"path"`
TotalLines int `json:"total_lines"`
CoveredLines int `json:"covered_lines"`
TotalFunctions int `json:"total_functions"`
CoveredFunctions int `json:"covered_functions"`
TotalBranches int `json:"total_branches"`
CoveredBranches int `json:"covered_branches"`
}
// CoverageMode represents the format of the coverage reprt
type CoverageMode string
const (
LCOV CoverageMode = "lcov"
COBERTURA CoverageMode = "cobertura"
CLOVER CoverageMode = "clover"
)