MozGTestBench.h (916B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 #ifndef GTEST_MOZGTESTBENCH_H 7 #define GTEST_MOZGTESTBENCH_H 8 9 #include <functional> 10 11 namespace mozilla { 12 13 void GTestBench(const char* aSuite, const char* aName, 14 const std::function<void()>& aTest); 15 16 } // namespace mozilla 17 18 #define MOZ_GTEST_BENCH(suite, test, lambdaOrFunc) \ 19 TEST(suite, test) \ 20 { \ 21 mozilla::GTestBench(#suite, #test, lambdaOrFunc); \ 22 } 23 24 #define MOZ_GTEST_BENCH_F(suite, test, lambdaOrFunc) \ 25 TEST_F(suite, test) { mozilla::GTestBench(#suite, #test, lambdaOrFunc); } 26 27 #endif // GTEST_MOZGTESTBENCH_H