Currently, c.Run can only be used if c.TB implements exactly
the Run method provided by *testing.T. However, there are
other possible implementations of testing.TB - most notably *testing.B,
which has its own Run method for invoking sub-benchmarks.
There could also be other potential implementations that don't involve the
testing package at all.
Instead of special-casing the Run method signatures implemented
by *testing.B and *testing.C, this PR allows Run to work on
any testing.TB implementation that takes a compatible function.
Currently, c.Run can only be used if c.TB implements exactly the Run method provided by
*testing.T
. However, there are other possible implementations oftesting.TB
- most notably*testing.B
, which has its own Run method for invoking sub-benchmarks.There could also be other potential implementations that don't involve the testing package at all.
Instead of special-casing the Run method signatures implemented by
*testing.B
and*testing.C
, this PR allows Run to work on anytesting.TB
implementation that takes a compatible function.