| 1 |
// Copyright 2013 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
// Support for test coverage. |
| 6 |
|
| 7 |
package testing |
| 8 |
|
| 9 |
// CoverBlock records the coverage data for a single basic block. |
| 10 |
// The fields are 1-indexed, as in an editor: The opening line of |
| 11 |
// the file is number 1, for example. Columns are measured |
| 12 |
// in bytes. |
| 13 |
// NOTE: This struct is internal to the testing infrastructure and may change. |
| 14 |
// It is not covered (yet) by the Go 1 compatibility guidelines. |
| 15 |
type CoverBlock struct { |
| 16 |
Line0 uint32 // Line number for block start. |
| 17 |
Col0 uint16 // Column number for block start. |
| 18 |
Line1 uint32 // Line number for block end. |
| 19 |
Col1 uint16 // Column number for block end. |
| 20 |
Stmts uint16 // Number of statements included in this block. |
| 21 |
} |
| 22 |
|
| 23 |
// Cover records information about test coverage checking. |
| 24 |
// NOTE: This struct is internal to the testing infrastructure and may change. |
| 25 |
// It is not covered (yet) by the Go 1 compatibility guidelines. |
| 26 |
type Cover struct { |
| 27 |
Mode string |
| 28 |
Counters map[string][]uint32 |
| 29 |
Blocks map[string][]CoverBlock |
| 30 |
CoveredPackages string |
| 31 |
} |
| 32 |
|
| 33 |
// RegisterCover records the coverage data accumulators for the tests. |
| 34 |
// NOTE: This function is internal to the testing infrastructure and may change. |
| 35 |
// It is not covered (yet) by the Go 1 compatibility guidelines. |
| 36 |
func RegisterCover(c Cover) { |
| 37 |
} |