mirror of
https://github.com/golang/go
synced 2024-11-23 10:50:09 -07:00
testing: fixes after the review
This commit is contained in:
parent
b9cdaa6ce6
commit
aa637756e7
@ -70,7 +70,7 @@ var benchmarkLock sync.Mutex
|
||||
var memStats runtime.MemStats
|
||||
|
||||
// InternalBenchmark is an internal type but exported because it is cross-package;
|
||||
// part of the implementation of the "go test" command.
|
||||
// it is part of the implementation of the "go test" command.
|
||||
type InternalBenchmark struct {
|
||||
Name string
|
||||
F func(b *B)
|
||||
@ -342,7 +342,7 @@ func (b *B) ReportMetric(n float64, unit string) {
|
||||
b.extra[unit] = n
|
||||
}
|
||||
|
||||
// BenchmarkResult is the results of a benchmark run.
|
||||
// BenchmarkResult contains the results of a benchmark run.
|
||||
type BenchmarkResult struct {
|
||||
N int // The number of iterations.
|
||||
T time.Duration // The total time taken.
|
||||
@ -489,7 +489,7 @@ type benchContext struct {
|
||||
}
|
||||
|
||||
// RunBenchmarks is an internal function but exported because it is cross-package;
|
||||
// part of the implementation of the "go test" command.
|
||||
// it is part of the implementation of the "go test" command.
|
||||
func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark) {
|
||||
runBenchmarks("", matchString, benchmarks)
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ type InternalExample struct {
|
||||
}
|
||||
|
||||
// RunExamples is an internal function but exported because it is cross-package;
|
||||
// part of the implementation of the "go test" command.
|
||||
// it is part of the implementation of the "go test" command.
|
||||
func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool) {
|
||||
_, ok = runExamples(matchString, examples)
|
||||
return ok
|
||||
|
@ -864,7 +864,7 @@ func (t *T) Parallel() {
|
||||
}
|
||||
|
||||
// InternalTest is an internal type but exported because it is cross-package;
|
||||
// part of the implementation of the "go test" command.
|
||||
// it is part of the implementation of the "go test" command.
|
||||
type InternalTest struct {
|
||||
Name string
|
||||
F func(*T)
|
||||
@ -1215,7 +1215,7 @@ func listTests(matchString func(pat, str string) (bool, error), tests []Internal
|
||||
}
|
||||
|
||||
// RunTests is an internal function but exported because it is cross-package;
|
||||
// part of the implementation of the "go test" command.
|
||||
// it is part of the implementation of the "go test" command.
|
||||
func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool) {
|
||||
ran, ok := runTests(matchString, tests)
|
||||
if !ran && !haveExamples {
|
||||
|
Loading…
Reference in New Issue
Block a user