Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: base/gtest_prod_util.h

Issue 11293028: GTTF: remove FAILS_ prefix, part 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/debug/stack_trace_unittest.cc ('k') | base/json/json_parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_GTEST_PROD_UTIL_H_ 5 #ifndef BASE_GTEST_PROD_UTIL_H_
6 #define BASE_GTEST_PROD_UTIL_H_ 6 #define BASE_GTEST_PROD_UTIL_H_
7 7
8 #include "testing/gtest/include/gtest/gtest_prod.h" 8 #include "testing/gtest/include/gtest/gtest_prod.h"
9 9
10 // This is a wrapper for gtest's FRIEND_TEST macro that friends 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 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. 12 // prefix, because the friend declarations don't need to be updated.
13 // 13 //
14 // Example usage: 14 // Example usage:
15 // 15 //
16 // class MyClass { 16 // class MyClass {
17 // private: 17 // private:
18 // void MyMethod(); 18 // void MyMethod();
19 // FRIEND_TEST_ALL_PREFIXES(MyClassTest, MyMethod); 19 // FRIEND_TEST_ALL_PREFIXES(MyClassTest, MyMethod);
20 // }; 20 // };
21 #define FRIEND_TEST_ALL_PREFIXES(test_case_name, test_name) \ 21 #define FRIEND_TEST_ALL_PREFIXES(test_case_name, test_name) \
22 FRIEND_TEST(test_case_name, test_name); \ 22 FRIEND_TEST(test_case_name, test_name); \
23 FRIEND_TEST(test_case_name, DISABLED_##test_name); \ 23 FRIEND_TEST(test_case_name, DISABLED_##test_name); \
24 FRIEND_TEST(test_case_name, FLAKY_##test_name); \ 24 FRIEND_TEST(test_case_name, FLAKY_##test_name)
25 FRIEND_TEST(test_case_name, FAILS_##test_name)
26 25
27 // C++ compilers will refuse to compile the following code: 26 // C++ compilers will refuse to compile the following code:
28 // 27 //
29 // namespace foo { 28 // namespace foo {
30 // class MyClass { 29 // class MyClass {
31 // private: 30 // private:
32 // FRIEND_TEST_ALL_PREFIXES(MyClassTest, TestMethod); 31 // FRIEND_TEST_ALL_PREFIXES(MyClassTest, TestMethod);
33 // bool private_var; 32 // bool private_var;
34 // }; 33 // };
35 // } // namespace foo 34 // } // namespace foo
(...skipping 19 matching lines...) Expand all
55 // } // namespace foo 54 // } // namespace foo
56 // 55 //
57 // class MyClassTest::TestMethod() { 56 // class MyClassTest::TestMethod() {
58 // foo::MyClass foo_class; 57 // foo::MyClass foo_class;
59 // foo_class.private_var = true; 58 // foo_class.private_var = true;
60 // } 59 // }
61 60
62 #define FORWARD_DECLARE_TEST(test_case_name, test_name) \ 61 #define FORWARD_DECLARE_TEST(test_case_name, test_name) \
63 class test_case_name##_##test_name##_Test; \ 62 class test_case_name##_##test_name##_Test; \
64 class test_case_name##_##DISABLED_##test_name##_Test; \ 63 class test_case_name##_##DISABLED_##test_name##_Test; \
65 class test_case_name##_##FLAKY_##test_name##_Test; \ 64 class test_case_name##_##FLAKY_##test_name##_Test
66 class test_case_name##_##FAILS_##test_name##_Test
67 65
68 #endif // BASE_GTEST_PROD_UTIL_H_ 66 #endif // BASE_GTEST_PROD_UTIL_H_
OLDNEW
« no previous file with comments | « base/debug/stack_trace_unittest.cc ('k') | base/json/json_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698