OLD | NEW |
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_TEST_TEST_SUITE_H_ | 5 #ifndef BASE_TEST_TEST_SUITE_H_ |
6 #define BASE_TEST_TEST_SUITE_H_ | 6 #define BASE_TEST_TEST_SUITE_H_ |
7 | 7 |
8 // Defines a basic test suite framework for running gtest based tests. You can | 8 // Defines a basic test suite framework for running gtest based tests. You can |
9 // instantiate this class in your main function and call its Run method to run | 9 // instantiate this class in your main function and call its Run method to run |
10 // any gtest based tests that are linked into your executable. | 10 // any gtest based tests that are linked into your executable. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Returns true if the test failed and the failure shouldn't be ignored. | 45 // Returns true if the test failed and the failure shouldn't be ignored. |
46 static bool NonIgnoredFailures(const testing::TestInfo& test); | 46 static bool NonIgnoredFailures(const testing::TestInfo& test); |
47 | 47 |
48 // Returns the number of tests where the match function returns true. | 48 // Returns the number of tests where the match function returns true. |
49 int GetTestCount(TestMatch test_match); | 49 int GetTestCount(TestMatch test_match); |
50 | 50 |
51 void CatchMaybeTests(); | 51 void CatchMaybeTests(); |
52 | 52 |
53 void ResetCommandLine(); | 53 void ResetCommandLine(); |
54 | 54 |
55 void WatchAtExitManager(); | |
56 | |
57 int Run(); | 55 int Run(); |
58 | 56 |
59 // A command-line flag that makes a test failure always result in a non-zero | 57 // A command-line flag that makes a test failure always result in a non-zero |
60 // process exit code. | 58 // process exit code. |
61 static const char kStrictFailureHandling[]; | 59 static const char kStrictFailureHandling[]; |
62 | 60 |
63 protected: | 61 protected: |
64 // This constructor is only accessible to specialized test suite | 62 // This constructor is only accessible to specialized test suite |
65 // implementations which need to control the creation of an AtExitManager | 63 // implementations which need to control the creation of an AtExitManager |
66 // instance for the duration of the test. | 64 // instance for the duration of the test. |
(...skipping 26 matching lines...) Expand all Loading... |
93 DISALLOW_COPY_AND_ASSIGN(TestSuite); | 91 DISALLOW_COPY_AND_ASSIGN(TestSuite); |
94 }; | 92 }; |
95 | 93 |
96 } // namespace base | 94 } // namespace base |
97 | 95 |
98 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile | 96 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile |
99 // until we can update it to use "base::" (preventing a two-sided patch). | 97 // until we can update it to use "base::" (preventing a two-sided patch). |
100 using base::TestSuite; | 98 using base::TestSuite; |
101 | 99 |
102 #endif // BASE_TEST_TEST_SUITE_H_ | 100 #endif // BASE_TEST_TEST_SUITE_H_ |
OLD | NEW |