gtest_prod_util.h revision c407dc5cd9bdc5668497f21b26b09d988ab439de
1// Copyright (c) 2010 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef BASE_GTEST_PROD_UTIL_H_ 6#define BASE_GTEST_PROD_UTIL_H_ 7 8#include "testing/gtest/include/gtest/gtest_prod.h" 9 10// This is a wrapper for gtest's FRIEND_TEST macro that friends 11// test with all possible prefixes. This is very helpful when changing the test 12// prefix, because the friend declarations don't need to be updated. 13// 14// Example usage: 15// 16// class MyClass { 17// private: 18// void MyMethod(); 19// FRIEND_TEST_ALL_PREFIXES(MyClassTest, MyMethod); 20// }; 21#define FRIEND_TEST_ALL_PREFIXES(test_case_name, test_name) \ 22 FRIEND_TEST(test_case_name, test_name); \ 23 FRIEND_TEST(test_case_name, DISABLED_##test_name); \ 24 FRIEND_TEST(test_case_name, FLAKY_##test_name); \ 25 FRIEND_TEST(test_case_name, FAILS_##test_name) 26 27#endif // BASE_GTEST_PROD_UTIL_H_ 28