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 #pragma once | 7 #pragma once |
8 | 8 |
9 // Defines a basic test suite framework for running gtest based tests. You can | 9 // Defines a basic test suite framework for running gtest based tests. You can |
10 // instantiate this class in your main function and call its Run method to run | 10 // instantiate this class in your main function and call its Run method to run |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 void CatchMaybeTests(); | 52 void CatchMaybeTests(); |
53 | 53 |
54 void ResetCommandLine(); | 54 void ResetCommandLine(); |
55 | 55 |
56 int Run(); | 56 int Run(); |
57 | 57 |
58 // A command-line flag that makes a test failure always result in a non-zero | 58 // A command-line flag that makes a test failure always result in a non-zero |
59 // process exit code. | 59 // process exit code. |
60 static const char kStrictFailureHandling[]; | 60 static const char kStrictFailureHandling[]; |
61 | 61 |
| 62 // A command-line flag that silences all gtest output. |
| 63 static const char kSilent[]; |
| 64 |
62 protected: | 65 protected: |
63 // This constructor is only accessible to specialized test suite | 66 // This constructor is only accessible to specialized test suite |
64 // implementations which need to control the creation of an AtExitManager | 67 // implementations which need to control the creation of an AtExitManager |
65 // instance for the duration of the test. | 68 // instance for the duration of the test. |
66 TestSuite(int argc, char** argv, bool create_at_exit_manager); | 69 TestSuite(int argc, char** argv, bool create_at_exit_manager); |
67 | 70 |
68 // By default fatal log messages (e.g. from DCHECKs) result in error dialogs | 71 // By default fatal log messages (e.g. from DCHECKs) result in error dialogs |
69 // which gum up buildbots. Use a minimalistic assert handler which just | 72 // which gum up buildbots. Use a minimalistic assert handler which just |
70 // terminates the process. | 73 // terminates the process. |
71 static void UnitTestAssertHandler(const std::string& str); | 74 static void UnitTestAssertHandler(const std::string& str); |
(...skipping 20 matching lines...) Expand all Loading... |
92 DISALLOW_COPY_AND_ASSIGN(TestSuite); | 95 DISALLOW_COPY_AND_ASSIGN(TestSuite); |
93 }; | 96 }; |
94 | 97 |
95 } // namespace base | 98 } // namespace base |
96 | 99 |
97 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile | 100 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile |
98 // until we can update it to use "base::" (preventing a two-sided patch). | 101 // until we can update it to use "base::" (preventing a two-sided patch). |
99 using base::TestSuite; | 102 using base::TestSuite; |
100 | 103 |
101 #endif // BASE_TEST_TEST_SUITE_H_ | 104 #endif // BASE_TEST_TEST_SUITE_H_ |
OLD | NEW |