From 154fb4e1d45e503658542dee5296243a6146e7ca Mon Sep 17 00:00:00 2001 From: Junyang Shao Date: Thu, 21 Nov 2024 07:36:25 +0000 Subject: testing: Update testing.B.Loop to save benchmark results. This is fixing some the missing logic of CL 627755. Change-Id: I35acffef7299331fce21da4a80a26185b2e909f4 Reviewed-on: https://go-review.googlesource.com/c/go/+/630455 Commit-Queue: Junyang Shao Reviewed-by: Cherry Mui LUCI-TryBot-Result: Go LUCI --- src/testing/testing_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/testing/testing_test.go') diff --git a/src/testing/testing_test.go b/src/testing/testing_test.go index 4bf6378782..1e32a1e615 100644 --- a/src/testing/testing_test.go +++ b/src/testing/testing_test.go @@ -989,6 +989,11 @@ func TestBenchmarkBLoopIterationCorrect(t *testing.T) { if c != want { t.Errorf("got %d loop rampup; want %d", c, want) } + + re := regexp.MustCompile(`BenchmarkBLoopPrint-[0-9]+\s*2\s*[0-9]+\s*ns/op.*`) + if !re.Match(out) { + t.Errorf("Missing benchmark output") + } } func TestBenchmarkBNIterationCorrect(t *testing.T) { -- cgit v1.3