From 7c758b0dfcbb4f65ed2dbd233911f60a58e19235 Mon Sep 17 00:00:00 2001 From: Brad Erickson Date: Sat, 10 Aug 2019 17:00:08 -0700 Subject: [PATCH] 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 --- src/testing/benchmark.go | 10 ++++++++++ tests/tinygotest/main_test.go | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 src/testing/benchmark.go diff --git a/src/testing/benchmark.go b/src/testing/benchmark.go new file mode 100644 index 00000000..cdc2c50a --- /dev/null +++ b/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 +} diff --git a/tests/tinygotest/main_test.go b/tests/tinygotest/main_test.go index 61ce2828..263aac14 100644 --- a/tests/tinygotest/main_test.go +++ b/tests/tinygotest/main_test.go @@ -14,3 +14,6 @@ func TestFail2(t *testing.T) { func TestPass(t *testing.T) { } + +func BenchmarkNotImplemented(b *testing.B) { +}