src/testing: stub B.ReportAllocs()

This allows test packages that use this feature in their benchmarks
to build and run (if not the benchmarks themselves).
Этот коммит содержится в:
Damian Gryski 2021-10-15 08:17:37 -07:00 коммит произвёл Ayke
родитель 18aaed63b9
коммит a88530b785

Просмотреть файл

@ -69,6 +69,12 @@ func (b *B) SetBytes(n int64) {
panic("testing: unimplemented: B.SetBytes") panic("testing: unimplemented: B.SetBytes")
} }
// ReportAllocs enables malloc statistics for this benchmark.
func (b *B) ReportAllocs() {
// Dummy version to allow building e.g. golang.org/crypto/...
panic("testing: unimplemented: B.ReportAllocs")
}
// StartTimer starts timing a test. This function is called automatically // StartTimer starts timing a test. This function is called automatically
// before a benchmark starts, but it can also be used to resume timing after // before a benchmark starts, but it can also be used to resume timing after
// a call to StopTimer. // a call to StopTimer.