func testGoCoverDir(t *testing.T) string { … } // TestTestSupport does a basic verification of the functionality in // ProcessCoverTestDir (doing this here as opposed to // relying on other test paths will provide a better signal when // running "go test -cover" for this package). func TestTestSupport(t *testing.T) { … } // Kicks off a sub-test to verify that Snapshot() works properly. // We do this as a separate shell-out, so as to avoid potential // interactions with -coverpkg. For example, if you do // // $ cd `go env GOROOT` // $ cd src/internal/coverage // $ go test -coverpkg=internal/coverage/decodecounter ./... // ... // $ // // The previous version of this test could fail due to the fact // that "cfile" itself was not being instrumented, as in the // scenario above. func TestCoverageSnapshot(t *testing.T) { … } const hellogo … // Returns a pair F,T where F is a meta-data file generated from // "hello.go" above, and T is a token to look for that should be // present in the coverage report from F. func genAuxMeta(t *testing.T, dstdir string) (string, string) { … } func TestAuxMetaDataFiles(t *testing.T) { … }