mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
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:
parent
f1756229b6
commit
0544a4cf70
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user