testing: Add Benchmark B struct stub

This struct allows test files containing basic benchmarks to compile
and run, but will not run the benchmarks themselves.

For #491
Этот коммит содержится в:
Brad Erickson 2019-08-10 17:00:08 -07:00 коммит произвёл Ayke
родитель 4ea59742d7
коммит 7c758b0dfc
2 изменённых файлов: 13 добавлений и 0 удалений

10
src/testing/benchmark.go Обычный файл
Просмотреть файл

@ -0,0 +1,10 @@
package testing
// B is a type passed to Benchmark functions to manage benchmark timing and to
// specify the number of iterations to run.
//
// TODO: Implement benchmarks. This struct allows test files containing
// benchmarks to compile and run, but will not run the benchmarks themselves.
type B struct {
N int
}

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

@ -14,3 +14,6 @@ func TestFail2(t *testing.T) {
func TestPass(t *testing.T) {
}
func BenchmarkNotImplemented(b *testing.B) {
}