Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoTestFound indicates that no tests could be found. ErrNoTestFound = errors.New("no tests could be found") )
Common errors over all languages.
View Source
var FileRangeMatch = regexp.MustCompile(`^(.+):(\d+):(\d+)-(.+):(\d+):(\d+)$`)
FileRangeMatch match a textual file range with lines and columns.
View Source
var Languages = map[string]Language{}
Languages holds a register of all languages.
Functions ¶
func CoverageObjectCountOfFile ¶ added in v0.5.0
CoverageObjectCountOfFile parses the given coverage file and returns its coverage object count.
Types ¶
type CoverageBlockUnfolded ¶ added in v0.5.0
type CoverageBlockUnfolded struct {
// FileRange holds the file range.
FileRange string
// CoverageType holds the covered coverage type.
CoverageType string
// Count holds the execution count.
Count uint
}
CoverageBlockUnfolded is an unfolded representation of a coverage data block.
type Language ¶
type Language interface {
// ID returns the unique ID of this language.
ID() (id string)
// Name is the prose name of this language.
Name() (id string)
// Files returns a list of relative file paths of the repository that should be evaluated.
Files(logger *log.Logger, repositoryPath string) (filePaths []string, err error)
// ImportPath returns the import path of the given source file.
ImportPath(projectRootPath string, filePath string) (importPath string)
// TestFilePath returns the file path of a test file given the corresponding file path of the test's source file.
TestFilePath(projectRootPath string, filePath string) (testFilePath string)
// TestFramework returns the human-readable name of the test framework that should be used.
TestFramework() (testFramework string)
// Execute invokes the language specific testing on the given repository.
Execute(logger *log.Logger, repositoryPath string) (coverage uint64, problems []error, err error)
}
Language defines a language to evaluate a repository.
Click to show internal directories.
Click to hide internal directories.