const testdata … // testcover returns the path to the cmd/cover binary that we are going to // test. At one point this was created via "go build"; we now reuse the unit // test executable itself. func testcover(t testing.TB) string { … } var testTempDir … var debug … // TestMain used here so that we can leverage the test executable // itself as a cmd/cover executable; compare to similar usage in // the cmd/go tests. func TestMain(m *testing.M) { … } var tdmu … var tdcount … func tempDir(t *testing.T) string { … } // TestCoverWithToolExec runs a set of subtests that all make use of a // "-toolexec" wrapper program to invoke the cover test executable // itself via "go test -cover". func TestCoverWithToolExec(t *testing.T) { … } // Execute this command sequence: // // replace the word LINE with the line number < testdata/test.go > testdata/test_line.go // testcover -mode=count -var=CoverTest -o ./testdata/test_cover.go testdata/test_line.go // go run ./testdata/main.go ./testdata/test.go func TestCover(t *testing.T) { … } // TestDirectives checks that compiler directives are preserved and positioned // correctly. Directives that occur before top-level declarations should remain // above those declarations, even if they are not part of the block of // documentation comments. func TestDirectives(t *testing.T) { … } type directiveInfo … func findDirectives(source []byte) []directiveInfo { … } // Makes sure that `cover -func=profile.cov` reports accurate coverage. // Issue #20515. func TestCoverFunc(t *testing.T) { … } // Check that cover produces correct HTML. // Issue #25767. func testCoverHTML(t *testing.T, toolexecArg string) { … } // Test HTML processing with a source file not run through gofmt. // Issue #27350. func testHtmlUnformatted(t *testing.T, toolexecArg string) { … } const lineDupContents … const lineDupTestContents … // Test -func with duplicate //line directives with different numbers // of statements. func testFuncWithDuplicateLines(t *testing.T, toolexecArg string) { … } func run(c *exec.Cmd, t *testing.T) { … } func runExpectingError(c *exec.Cmd, t *testing.T) string { … } // Test instrumentation of package that ends before an expected // trailing newline following package clause. Issue #58370. func testMissingTrailingNewlineIssue58370(t *testing.T, toolexecArg string) { … } func TestSrcPathWithNewline(t *testing.T) { … }