codecoverage

package
v0.0.0-...-bbc9ce3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigCategory_name = map[int32]string{
		0: "BUILD",
		1: "TEST",
		2: "TESTHARNESS",
		3: "COVERAGE_TOOL",
	}
	ConfigCategory_value = map[string]int32{
		"BUILD":         0,
		"TEST":          1,
		"TESTHARNESS":   2,
		"COVERAGE_TOOL": 3,
	}
)

Enum value maps for ConfigCategory.

View Source
var File_code_coverage_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Branch

type Branch struct {

	// The line number which the branch info belongs to.
	Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"`
	// The total number of branches.
	Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
	// The number of covered branches.
	Covered int32 `protobuf:"varint,3,opt,name=covered,proto3" json:"covered,omitempty"`
	// contains filtered or unexported fields
}

Represents the code coverage of code branches at a line.

func (*Branch) Descriptor deprecated

func (*Branch) Descriptor() ([]byte, []int)

Deprecated: Use Branch.ProtoReflect.Descriptor instead.

func (*Branch) GetCovered

func (x *Branch) GetCovered() int32

func (*Branch) GetLine

func (x *Branch) GetLine() int32

func (*Branch) GetTotal

func (x *Branch) GetTotal() int32

func (*Branch) ProtoMessage

func (*Branch) ProtoMessage()

func (*Branch) ProtoReflect

func (x *Branch) ProtoReflect() protoreflect.Message

func (*Branch) Reset

func (x *Branch) Reset()

func (*Branch) String

func (x *Branch) String() string

type ColumnRange

type ColumnRange struct {

	// The first column of the code block. Inclusive.
	First int32 `protobuf:"varint,1,opt,name=first,proto3" json:"first,omitempty"`
	// The last column of the code block. Inclusive.
	// If not set, it is the same as `first` above.
	Last int32 `protobuf:"varint,2,opt,name=last,proto3" json:"last,omitempty"`
	// contains filtered or unexported fields
}

Represents column range within the same line.

func (*ColumnRange) Descriptor deprecated

func (*ColumnRange) Descriptor() ([]byte, []int)

Deprecated: Use ColumnRange.ProtoReflect.Descriptor instead.

func (*ColumnRange) GetFirst

func (x *ColumnRange) GetFirst() int32

func (*ColumnRange) GetLast

func (x *ColumnRange) GetLast() int32

func (*ColumnRange) ProtoMessage

func (*ColumnRange) ProtoMessage()

func (*ColumnRange) ProtoReflect

func (x *ColumnRange) ProtoReflect() protoreflect.Message

func (*ColumnRange) Reset

func (x *ColumnRange) Reset()

func (*ColumnRange) String

func (x *ColumnRange) String() string

type ColumnRanges

type ColumnRanges struct {

	// The line number of the code block.
	Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"`
	// The column ranges within the line.
	Ranges []*ColumnRange `protobuf:"bytes,2,rep,name=ranges,proto3" json:"ranges,omitempty"`
	// contains filtered or unexported fields
}

Represents multiple column ranges of a line.

func (*ColumnRanges) Descriptor deprecated

func (*ColumnRanges) Descriptor() ([]byte, []int)

Deprecated: Use ColumnRanges.ProtoReflect.Descriptor instead.

func (*ColumnRanges) GetLine

func (x *ColumnRanges) GetLine() int32

func (*ColumnRanges) GetRanges

func (x *ColumnRanges) GetRanges() []*ColumnRange

func (*ColumnRanges) ProtoMessage

func (*ColumnRanges) ProtoMessage()

func (*ColumnRanges) ProtoReflect

func (x *ColumnRanges) ProtoReflect() protoreflect.Message

func (*ColumnRanges) Reset

func (x *ColumnRanges) Reset()

func (*ColumnRanges) String

func (x *ColumnRanges) String() string

type ConfigCategory

type ConfigCategory int32

Represents a configuration category that is related to the coverage data.

const (
	// Related to produce the test binary and data.
	ConfigCategory_BUILD ConfigCategory = 0
	// Related to run the tests.
	ConfigCategory_TEST ConfigCategory = 1
	// Related to the test itself.
	ConfigCategory_TESTHARNESS ConfigCategory = 2
	// Related to the coverage tool.
	ConfigCategory_COVERAGE_TOOL ConfigCategory = 3
)

func (ConfigCategory) Descriptor

func (ConfigCategory) Enum

func (x ConfigCategory) Enum() *ConfigCategory

func (ConfigCategory) EnumDescriptor deprecated

func (ConfigCategory) EnumDescriptor() ([]byte, []int)

Deprecated: Use ConfigCategory.Descriptor instead.

func (ConfigCategory) Number

func (ConfigCategory) String

func (x ConfigCategory) String() string

func (ConfigCategory) Type

type ConfigSetting

type ConfigSetting struct {

	// The category of the setting.
	Category ConfigCategory `protobuf:"varint,1,opt,name=category,proto3,enum=codecoverage.ConfigCategory" json:"category,omitempty"`
	// Name of the key, e.g. "builder".
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Value for the key, e.g. "Linux Builder".
	Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Represents a config setting.

func (*ConfigSetting) Descriptor deprecated

func (*ConfigSetting) Descriptor() ([]byte, []int)

Deprecated: Use ConfigSetting.ProtoReflect.Descriptor instead.

func (*ConfigSetting) GetCategory

func (x *ConfigSetting) GetCategory() ConfigCategory

func (*ConfigSetting) GetName

func (x *ConfigSetting) GetName() string

func (*ConfigSetting) GetValue

func (x *ConfigSetting) GetValue() string

func (*ConfigSetting) ProtoMessage

func (*ConfigSetting) ProtoMessage()

func (*ConfigSetting) ProtoReflect

func (x *ConfigSetting) ProtoReflect() protoreflect.Message

func (*ConfigSetting) Reset

func (x *ConfigSetting) Reset()

func (*ConfigSetting) String

func (x *ConfigSetting) String() string

type CoverageReport

type CoverageReport struct {

	// Either a Gitiles commit or a Gerrit patch must be provided.
	Commit *GitilesCommit `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"`
	Patch  *GerritPatch   `protobuf:"bytes,2,opt,name=patch,proto3" json:"patch,omitempty"`
	// The build/test/etc configurations that were used to generate coverage data.
	BuildConfigs []*ConfigSetting `protobuf:"bytes,3,rep,name=build_configs,json=buildConfigs,proto3" json:"build_configs,omitempty"`
	// Code coverage info of individual source files.
	Files []*File `protobuf:"bytes,4,rep,name=files,proto3" json:"files,omitempty"`
	// Code coverage info of individual source files saved in separate files.
	FileShards []string `protobuf:"bytes,5,rep,name=file_shards,json=fileShards,proto3" json:"file_shards,omitempty"`
	// Code coverage summary for all directories.
	Dirs []*GroupCoverageSummary `protobuf:"bytes,6,rep,name=dirs,proto3" json:"dirs,omitempty"`
	// Code coverage summary for all crbug components.
	Components []*GroupCoverageSummary `protobuf:"bytes,7,rep,name=components,proto3" json:"components,omitempty"`
	// Code coverage summary for the root directory.
	Summaries []*Metric `protobuf:"bytes,8,rep,name=summaries,proto3" json:"summaries,omitempty"`
	// contains filtered or unexported fields
}

Represents a code coverage report.

func (*CoverageReport) Descriptor deprecated

func (*CoverageReport) Descriptor() ([]byte, []int)

Deprecated: Use CoverageReport.ProtoReflect.Descriptor instead.

func (*CoverageReport) GetBuildConfigs

func (x *CoverageReport) GetBuildConfigs() []*ConfigSetting

func (*CoverageReport) GetCommit

func (x *CoverageReport) GetCommit() *GitilesCommit

func (*CoverageReport) GetComponents

func (x *CoverageReport) GetComponents() []*GroupCoverageSummary

func (*CoverageReport) GetDirs

func (x *CoverageReport) GetDirs() []*GroupCoverageSummary

func (*CoverageReport) GetFileShards

func (x *CoverageReport) GetFileShards() []string

func (*CoverageReport) GetFiles

func (x *CoverageReport) GetFiles() []*File

func (*CoverageReport) GetPatch

func (x *CoverageReport) GetPatch() *GerritPatch

func (*CoverageReport) GetSummaries

func (x *CoverageReport) GetSummaries() []*Metric

func (*CoverageReport) ProtoMessage

func (*CoverageReport) ProtoMessage()

func (*CoverageReport) ProtoReflect

func (x *CoverageReport) ProtoReflect() protoreflect.Message

func (*CoverageReport) Reset

func (x *CoverageReport) Reset()

func (*CoverageReport) String

func (x *CoverageReport) String() string

type CoverageSummary

type CoverageSummary struct {

	// The name of the file, directory, or crbug component.
	// For a directory, it should end with a "/", e.g. "base/".
	// For a file, it should be the file name.
	// For a crbug component, it should be the full path.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The full path to the file, directory, or crbug component.
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// The metrics for the file or directory.
	Summaries []*Metric `protobuf:"bytes,3,rep,name=summaries,proto3" json:"summaries,omitempty"`
	// contains filtered or unexported fields
}

Represents the summary metrics for a given file or a directory.

func (*CoverageSummary) Descriptor deprecated

func (*CoverageSummary) Descriptor() ([]byte, []int)

Deprecated: Use CoverageSummary.ProtoReflect.Descriptor instead.

func (*CoverageSummary) GetName

func (x *CoverageSummary) GetName() string

func (*CoverageSummary) GetPath

func (x *CoverageSummary) GetPath() string

func (*CoverageSummary) GetSummaries

func (x *CoverageSummary) GetSummaries() []*Metric

func (*CoverageSummary) ProtoMessage

func (*CoverageSummary) ProtoMessage()

func (*CoverageSummary) ProtoReflect

func (x *CoverageSummary) ProtoReflect() protoreflect.Message

func (*CoverageSummary) Reset

func (x *CoverageSummary) Reset()

func (*CoverageSummary) String

func (x *CoverageSummary) String() string

type File

type File struct {

	// Source absolute path to the file, e.g. '//base/file.cc'.
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// The code coverage info of the lines in the file.
	// If a line is not executable or not instrumented to collect coverage info,
	// it is not coverable and won't be included here.
	Lines []*LineRange `protobuf:"bytes,3,rep,name=lines,proto3" json:"lines,omitempty"`
	// The uncovered code blocks in the file.
	UncoveredBlocks []*ColumnRanges `protobuf:"bytes,4,rep,name=uncovered_blocks,json=uncoveredBlocks,proto3" json:"uncovered_blocks,omitempty"`
	// The code branch info for if/else/etc.
	Branches []*Branch `protobuf:"bytes,5,rep,name=branches,proto3" json:"branches,omitempty"`
	// Code coverage summary for the file.
	Summaries []*Metric `protobuf:"bytes,6,rep,name=summaries,proto3" json:"summaries,omitempty"`
	// The git hash (up to the revision in the checkout) of the commit in Gitiles
	// when the file was most recently changed.
	// E.g. fc7b1de555d4b1fe5b7ff2e4c99662a10cf4ddd6.
	// Empty if the file not tracked by gitiles, such as generated source files.
	Revision string `protobuf:"bytes,7,opt,name=revision,proto3" json:"revision,omitempty"`
	// The UNIX timestamp of the committer date for the revision above.
	Timestamp int64 `protobuf:"varint,8,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

Represents the code coverage info of a single source file.

func (*File) Descriptor deprecated

func (*File) Descriptor() ([]byte, []int)

Deprecated: Use File.ProtoReflect.Descriptor instead.

func (*File) GetBranches

func (x *File) GetBranches() []*Branch

func (*File) GetLines

func (x *File) GetLines() []*LineRange

func (*File) GetPath

func (x *File) GetPath() string

func (*File) GetRevision

func (x *File) GetRevision() string

func (*File) GetSummaries

func (x *File) GetSummaries() []*Metric

func (*File) GetTimestamp

func (x *File) GetTimestamp() int64

func (*File) GetUncoveredBlocks

func (x *File) GetUncoveredBlocks() []*ColumnRanges

func (*File) ProtoMessage

func (*File) ProtoMessage()

func (*File) ProtoReflect

func (x *File) ProtoReflect() protoreflect.Message

func (*File) Reset

func (x *File) Reset()

func (*File) String

func (x *File) String() string

type GerritPatch

type GerritPatch struct {

	// Hostname of the Gerrit server, e.g. chromium-review.googlesource.com.
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	// The id of the CL, e.g. 1296501.
	Cl int32 `protobuf:"varint,2,opt,name=cl,proto3" json:"cl,omitempty"`
	// The id of the patch in the CL, e.g. 43.
	Patch int32 `protobuf:"varint,3,opt,name=patch,proto3" json:"patch,omitempty"`
	// Project name of the CL, e.g. chromium/src.
	// Optional, since the cl number is unique in a Gerrit server.
	Project string `protobuf:"bytes,4,opt,name=project,proto3" json:"project,omitempty"`
	// contains filtered or unexported fields
}

Represents a patch of a CL in a Gerrit project.

func (*GerritPatch) Descriptor deprecated

func (*GerritPatch) Descriptor() ([]byte, []int)

Deprecated: Use GerritPatch.ProtoReflect.Descriptor instead.

func (*GerritPatch) GetCl

func (x *GerritPatch) GetCl() int32

func (*GerritPatch) GetHost

func (x *GerritPatch) GetHost() string

func (*GerritPatch) GetPatch

func (x *GerritPatch) GetPatch() int32

func (*GerritPatch) GetProject

func (x *GerritPatch) GetProject() string

func (*GerritPatch) ProtoMessage

func (*GerritPatch) ProtoMessage()

func (*GerritPatch) ProtoReflect

func (x *GerritPatch) ProtoReflect() protoreflect.Message

func (*GerritPatch) Reset

func (x *GerritPatch) Reset()

func (*GerritPatch) String

func (x *GerritPatch) String() string

type GitilesCommit

type GitilesCommit struct {

	// Hostname of the Gitiles server, e.g. chromium.googlesource.com.
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	// Project name in the Gitiles, e.g. chromium/src.
	Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"`
	// The git hash of the commit in Gitiles, e.g.
	// fc7b1de555d4b1fe5b7ff2e4c99662a10cf4ddd6.
	Revision string `protobuf:"bytes,3,opt,name=revision,proto3" json:"revision,omitempty"`
	// The commit position of the commit in Gitiles, e.g. 606065.
	// since not every repository has commit position.
	CommitPosition int32 `protobuf:"varint,4,opt,name=commit_position,json=commitPosition,proto3" json:"commit_position,omitempty"`
	// contains filtered or unexported fields
}

Represents a commit in a Gitiles repository.

func (*GitilesCommit) Descriptor deprecated

func (*GitilesCommit) Descriptor() ([]byte, []int)

Deprecated: Use GitilesCommit.ProtoReflect.Descriptor instead.

func (*GitilesCommit) GetCommitPosition

func (x *GitilesCommit) GetCommitPosition() int32

func (*GitilesCommit) GetHost

func (x *GitilesCommit) GetHost() string

func (*GitilesCommit) GetProject

func (x *GitilesCommit) GetProject() string

func (*GitilesCommit) GetRevision

func (x *GitilesCommit) GetRevision() string

func (*GitilesCommit) ProtoMessage

func (*GitilesCommit) ProtoMessage()

func (*GitilesCommit) ProtoReflect

func (x *GitilesCommit) ProtoReflect() protoreflect.Message

func (*GitilesCommit) Reset

func (x *GitilesCommit) Reset()

func (*GitilesCommit) String

func (x *GitilesCommit) String() string

type GroupCoverageSummary

type GroupCoverageSummary struct {

	// Two cases:
	// * The full path of the directory relative to the root of the code base.
	//   For a directory, this should end with a "/", e.g. "//base/".
	//   For the root directory, this should be "//".
	// * The full path of the crbug component like "Blink>Storage>AppCache".
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// The coverage metrics for its sub directories.
	Dirs []*CoverageSummary `protobuf:"bytes,2,rep,name=dirs,proto3" json:"dirs,omitempty"`
	// The coverage metrics for all the files within the directory.
	Files []*CoverageSummary `protobuf:"bytes,3,rep,name=files,proto3" json:"files,omitempty"`
	// Code coverage summary for the group.
	Summaries []*Metric `protobuf:"bytes,6,rep,name=summaries,proto3" json:"summaries,omitempty"`
	// contains filtered or unexported fields
}

Represents the summary metrics for: * A single directory and its immediate children. * All directories mapping to a single crbug component.

func (*GroupCoverageSummary) Descriptor deprecated

func (*GroupCoverageSummary) Descriptor() ([]byte, []int)

Deprecated: Use GroupCoverageSummary.ProtoReflect.Descriptor instead.

func (*GroupCoverageSummary) GetDirs

func (x *GroupCoverageSummary) GetDirs() []*CoverageSummary

func (*GroupCoverageSummary) GetFiles

func (x *GroupCoverageSummary) GetFiles() []*CoverageSummary

func (*GroupCoverageSummary) GetPath

func (x *GroupCoverageSummary) GetPath() string

func (*GroupCoverageSummary) GetSummaries

func (x *GroupCoverageSummary) GetSummaries() []*Metric

func (*GroupCoverageSummary) ProtoMessage

func (*GroupCoverageSummary) ProtoMessage()

func (*GroupCoverageSummary) ProtoReflect

func (x *GroupCoverageSummary) ProtoReflect() protoreflect.Message

func (*GroupCoverageSummary) Reset

func (x *GroupCoverageSummary) Reset()

func (*GroupCoverageSummary) String

func (x *GroupCoverageSummary) String() string

type LineRange

type LineRange struct {

	// The first line in the range. Inclusive.
	First int32 `protobuf:"varint,1,opt,name=first,proto3" json:"first,omitempty"`
	// The last line in the range. Inclusive.
	// If not set, it is the same as `first` above.
	Last int32 `protobuf:"varint,2,opt,name=last,proto3" json:"last,omitempty"`
	// Meaning of values:
	// * positive: the lines are covered.
	// * zero: the lines are instrumented but not covered by tests.
	// * negative: if the lines are uncoverable or uninstrumented
	//
	// If the coverage tool doesn't support counting how many times a line was
	// executed, the value could only be 1 or 0; otherwise the value could be
	// larger than 1. If the values are the exactly the same for a few consecutive
	// lines, they could be merged into one bigger line range.
	// For example, four small ranges in the middle are merged into a bigger one.
	// |line number|actual count|
	// |28         |1           |   --->  LineRange(?, 28, 1)
	// |29         |10          |   --->  LineRange(29, 32, 10)
	// |30         |10          |
	// |31         |10          |
	// |32         |10          |
	// |33         |1           |   --->  LineRange(33, ?, 1)
	//
	// TODO(crbug.com/925886): As of Jan 28th, 2019, there could be negative
	// |count| in the metadata.
	Count int64 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

Represents the code coverage for multiple full lines in the file.

func (*LineRange) Descriptor deprecated

func (*LineRange) Descriptor() ([]byte, []int)

Deprecated: Use LineRange.ProtoReflect.Descriptor instead.

func (*LineRange) GetCount

func (x *LineRange) GetCount() int64

func (*LineRange) GetFirst

func (x *LineRange) GetFirst() int32

func (*LineRange) GetLast

func (x *LineRange) GetLast() int32

func (*LineRange) ProtoMessage

func (*LineRange) ProtoMessage()

func (*LineRange) ProtoReflect

func (x *LineRange) ProtoReflect() protoreflect.Message

func (*LineRange) Reset

func (x *LineRange) Reset()

func (*LineRange) String

func (x *LineRange) String() string

type Metric

type Metric struct {

	// The name of the metric, e.g. "line", "function", "region", etc.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The total number of coverable ones.
	Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
	// The number of covered ones.
	Covered int32 `protobuf:"varint,3,opt,name=covered,proto3" json:"covered,omitempty"`
	// contains filtered or unexported fields
}

Represents a code coverage metric of a file or a directory.

func (*Metric) Descriptor deprecated

func (*Metric) Descriptor() ([]byte, []int)

Deprecated: Use Metric.ProtoReflect.Descriptor instead.

func (*Metric) GetCovered

func (x *Metric) GetCovered() int32

func (*Metric) GetName

func (x *Metric) GetName() string

func (*Metric) GetTotal

func (x *Metric) GetTotal() int32

func (*Metric) ProtoMessage

func (*Metric) ProtoMessage()

func (*Metric) ProtoReflect

func (x *Metric) ProtoReflect() protoreflect.Message

func (*Metric) Reset

func (x *Metric) Reset()

func (*Metric) String

func (x *Metric) String() string

Jump to

Keyboard shortcuts

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