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. |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/at_exit.h" | 14 #include "base/at_exit.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/test/trace_to_file.h" |
16 | 17 |
17 namespace testing { | 18 namespace testing { |
18 class TestInfo; | 19 class TestInfo; |
19 } | 20 } |
20 | 21 |
21 namespace base { | 22 namespace base { |
22 | 23 |
23 // Instantiates TestSuite, runs it and returns exit code. | 24 // Instantiates TestSuite, runs it and returns exit code. |
24 int RunUnitTestsUsingBaseTestSuite(int argc, char **argv); | 25 int RunUnitTestsUsingBaseTestSuite(int argc, char **argv); |
25 | 26 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 74 |
74 private: | 75 private: |
75 void InitializeFromCommandLine(int argc, char** argv); | 76 void InitializeFromCommandLine(int argc, char** argv); |
76 #if defined(OS_WIN) | 77 #if defined(OS_WIN) |
77 void InitializeFromCommandLine(int argc, wchar_t** argv); | 78 void InitializeFromCommandLine(int argc, wchar_t** argv); |
78 #endif // defined(OS_WIN) | 79 #endif // defined(OS_WIN) |
79 | 80 |
80 // Basic initialization for the test suite happens here. | 81 // Basic initialization for the test suite happens here. |
81 void PreInitialize(bool create_at_exit_manager); | 82 void PreInitialize(bool create_at_exit_manager); |
82 | 83 |
| 84 test::TraceToFile trace_to_file_; |
| 85 |
83 bool initialized_command_line_; | 86 bool initialized_command_line_; |
84 | 87 |
85 DISALLOW_COPY_AND_ASSIGN(TestSuite); | 88 DISALLOW_COPY_AND_ASSIGN(TestSuite); |
86 }; | 89 }; |
87 | 90 |
88 } // namespace base | 91 } // namespace base |
89 | 92 |
90 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile | 93 // TODO(brettw) remove this. This is a temporary hack to allow WebKit to compile |
91 // until we can update it to use "base::" (preventing a two-sided patch). | 94 // until we can update it to use "base::" (preventing a two-sided patch). |
92 using base::TestSuite; | 95 using base::TestSuite; |
93 | 96 |
94 #endif // BASE_TEST_TEST_SUITE_H_ | 97 #endif // BASE_TEST_TEST_SUITE_H_ |
OLD | NEW |