2

In google test, people can use TestWithParam for customized parameter in a fixture. That is to say, write a class that inheritates testing::TestWithParam<Customed_Params> class, in which Customed_Params is my own defined class that holds customed parameters, such as the mixture of ints and strings.

However in google benchmark library (the performance testsing library), there isn't TestWithParam. There is Args() member function for the Benchmark class, but it only accept int64_t type parameters, and my std::string type parameter can't be passed.

i.e.

BENCHMARK_REGISTER_F(AreaResizeFast_Fixture, cv)
    ->Unit(benchmark::kMillisecond)
    ->UseRealTime()
    ->Args({"1.jpg", 2, 2})  // the 1.jpg can't be passed
    ->Args({"2.jpg", 3, 3}); // the 2.jpg can't be passed
ChrisZZ
  • 1,521
  • 2
  • 17
  • 24

0 Answers0