Bug 1434671 - add a benchmarking macro permitting custom test fixtures; r=ted.mielczarek

GTest supports the TEST macro, which just runs a bunch of tests, and the
TEST_F macro, which enables writing custom test fixtures to perform
per-test setup and teardown.  The benchmarking framework we have has a
corresponding macro for the former, but no corresponding macro for the
latter.  If there's significant work to be done during setup and
teardown, we certainly don't want to be doing that work during the
actual benchmarking!  So let's introduce a MOZ_GTEST_BENCH_F macro that
works similarly to the TEST_F macro.
This commit is contained in:
Nathan Froyd 2018-02-26 17:31:58 -04:00
parent f1756229b6
commit 0544a4cf70

View File

@ -19,4 +19,9 @@ TEST(suite, test) { \
mozilla::GTestBench(#suite, #test, lambdaOrFunc); \
}
#define MOZ_GTEST_BENCH_F(suite, test, lambdaOrFunc) \
TEST_F(suite, test) { \
mozilla::GTestBench(#suite, #test, lambdaOrFunc); \
}
#endif // GTEST_MOZGTESTBENCH_H