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 | |
65 protected: | 62 protected: |
66 // This constructor is only accessible to specialized test suite | 63 // This constructor is only accessible to specialized test suite |
67 // implementations which need to control the creation of an AtExitManager | 64 // implementations which need to control the creation of an AtExitManager |
68 // instance for the duration of the test. | 65 // instance for the duration of the test. |
69 TestSuite(int argc, char** argv, bool create_at_exit_manager); | 66 TestSuite(int argc, char** argv, bool create_at_exit_manager); |
70 | 67 |
71 // By default fatal log messages (e.g. from DCHECKs) result in error dialogs | 68 // By default fatal log messages (e.g. from DCHECKs) result in error dialogs |
72 // which gum up buildbots. Use a minimalistic assert handler which just | 69 // which gum up buildbots. Use a minimalistic assert handler which just |
73 // terminates the process. | 70 // terminates the process. |
74 static void UnitTestAssertHandler(const std::string& str); | 71 static void UnitTestAssertHandler(const std::string& str); |
(...skipping 20 matching lines...) Expand all Loading... |
95 DISALLOW_COPY_AND_ASSIGN(TestSuite); | 92 DISALLOW_COPY_AND_ASSIGN(TestSuite); |
96 }; | 93 }; |
97 | 94 |
98 } // namespace base | 95 } // namespace base |
99 | 96 |
100 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile | 97 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile |
101 // until we can update it to use "base::" (preventing a two-sided patch). | 98 // until we can update it to use "base::" (preventing a two-sided patch). |
102 using base::TestSuite; | 99 using base::TestSuite; |
103 | 100 |
104 #endif // BASE_TEST_TEST_SUITE_H_ | 101 #endif // BASE_TEST_TEST_SUITE_H_ |
OLD | NEW |