There isn't much we can verify in a stable fashion, so we just run the benchmark with max_iters, and ensure we end up with that many iter stats.
| 26 | // There isn't much we can verify in a stable fashion, so we just run the |
| 27 | // benchmark with max_iters, and ensure we end up with that many iter stats. |
| 28 | TEST(Benchmark, Benchmark) { |
| 29 | AddComp add; |
| 30 | |
| 31 | Options options; |
| 32 | options.max_iters = 1; |
| 33 | Stats stats1; |
| 34 | Benchmark(options, [&] { add.Run(); }, &stats1); |
| 35 | EXPECT_EQ(stats1.per_iter_us.size(), 1); |
| 36 | |
| 37 | options.max_iters = 5; |
| 38 | Stats stats5; |
| 39 | Benchmark(options, [&] { add.Run(); }, &stats5); |
| 40 | EXPECT_EQ(stats5.per_iter_us.size(), 5); |
| 41 | } |
| 42 | |
| 43 | } // namespace |
| 44 | } // namespace benchmark |