test

package
v8.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOriginalTargetsToCoverage

func AddOriginalTargetsToCoverage(state *core.BuildState, includeAllFiles bool)

Adds empty coverage entries for any files covered by the original query that we haven't discovered through tests to the overall report. The coverage reports only contain information about files that were covered during tests, so it's important that we identify anything with zero coverage here. This is made trickier by attempting to reconcile coverage targets from languages like Java that don't preserve the original file structure, which requires a slightly fuzzy match.

func CountCoverage

func CountCoverage(lines []core.LineCoverage) (int, int)

CountCoverage counts the number of lines covered and the total number coverable in a single file.

func RemoveCachedTestFiles

func RemoveCachedTestFiles(target *core.BuildTarget) error

RemoveCachedTestFiles removes any cached test or coverage result files for a target.

func RemoveFilesFromCoverage

func RemoveFilesFromCoverage(coverage core.TestCoverage, extensions []string)

RemoveFilesFromCoverage removes any files with extensions matching the given set from coverage.

func Test

func Test(tid int, state *core.BuildState, label core.BuildLabel)

func WriteCoverageToFileOrDie

func WriteCoverageToFileOrDie(coverage core.TestCoverage, filename string)

WriteCoverageToFileOrDie writes the collected coverage data to a file in JSON format. Dies on failure.

func WriteResultsToFileOrDie

func WriteResultsToFileOrDie(graph *core.BuildGraph, filename string)

Write test results out to a file in xUnit format. Dies on any errors.

Types

type JUnitXMLFailure

type JUnitXMLFailure struct {
	Message   string `xml:"message,attr,omitempty"`
	Type      string `xml:"type,attr,omitempty"`
	Traceback string `xml:",chardata"`
}

type JUnitXMLTest

type JUnitXMLTest struct {
	ClassName  string           `xml:"classname,attr,omitempty"`
	Name       string           `xml:"name,attr"`
	Failure    *JUnitXMLFailure `xml:"failure,omitempty"`
	Error      *JUnitXMLFailure `xml:"error,omitempty"`
	Time       float64          `xml:"time,attr,omitempty"`
	Type       string           `xml:"type,attr,omitempty"`
	Success    string           `xml:"success,attr,omitempty"`
	Stacktrace string           `xml:"stacktrace,attr,omitempty"`
	Stdout     string           `xml:"stdout,omitempty"`
	Stderr     string           `xml:"stderr,omitempty"`
}

type JUnitXMLTestResults

type JUnitXMLTestResults struct {
	TestSuites []JUnitXMLTestSuite `xml:"testsuite"`
	TestCases  []JUnitXMLTest      `xml:"testcase"`
	Tests      []JUnitXMLTest      `xml:"test"`
	XMLName    xml.Name
}

type JUnitXMLTestSuite

type JUnitXMLTestSuite struct {
	Name      string         `xml:"name,attr"`
	Failures  int            `xml:"failures,attr,omitempty"`
	Tests     int            `xml:"tests,attr"`
	TestCases []JUnitXMLTest `xml:"testcase"`
}

Jump to

Keyboard shortcuts

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