OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_LAUNCHER_TEST_LAUNCHER_H_ | 5 #ifndef BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ |
6 #define BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ | 6 #define BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 // on the same thread this method was called. | 108 // on the same thread this method was called. |
109 void LaunchChildGTestProcess(const CommandLine& command_line, | 109 void LaunchChildGTestProcess(const CommandLine& command_line, |
110 const std::string& wrapper, | 110 const std::string& wrapper, |
111 base::TimeDelta timeout, | 111 base::TimeDelta timeout, |
112 int flags, | 112 int flags, |
113 const LaunchChildGTestProcessCallback& callback); | 113 const LaunchChildGTestProcessCallback& callback); |
114 | 114 |
115 // Called when a test has finished running. | 115 // Called when a test has finished running. |
116 void OnTestFinished(const TestResult& result); | 116 void OnTestFinished(const TestResult& result); |
117 | 117 |
118 // If enabled, the launcher will not remove the --gtest_output flag passed | |
119 // to the child processes. | |
120 void set_use_child_gtest_output(bool value) { | |
Paweł Hajdan Jr.
2015/05/29 13:48:20
This looks like a layering violation. Why is it ne
hidehiko
2015/05/29 14:00:47
Because nacl_helper_nonsfi_unittests_main still us
Paweł Hajdan Jr.
2015/06/01 10:56:59
Is it possible to extract a smaller build target c
hidehiko
2015/06/02 08:12:17
Ok, thank you for suggestion.
Then, how about the
| |
121 use_child_gtest_output_ = value; | |
122 } | |
123 | |
118 private: | 124 private: |
119 bool Init() WARN_UNUSED_RESULT; | 125 bool Init() WARN_UNUSED_RESULT; |
120 | 126 |
121 // Runs all tests in current iteration. Uses callbacks to communicate success. | 127 // Runs all tests in current iteration. Uses callbacks to communicate success. |
122 void RunTests(); | 128 void RunTests(); |
123 | 129 |
124 void RunTestIteration(); | 130 void RunTestIteration(); |
125 | 131 |
126 // Saves test results summary as JSON if requested from command line. | 132 // Saves test results summary as JSON if requested from command line. |
127 void MaybeSaveSummaryAsJSON(); | 133 void MaybeSaveSummaryAsJSON(); |
(...skipping 14 matching lines...) Expand all Loading... | |
142 | 148 |
143 // Make sure we don't accidentally call the wrong methods e.g. on the worker | 149 // Make sure we don't accidentally call the wrong methods e.g. on the worker |
144 // pool thread. With lots of callbacks used this is non-trivial. | 150 // pool thread. With lots of callbacks used this is non-trivial. |
145 // Should be the first member so that it's destroyed last: when destroying | 151 // Should be the first member so that it's destroyed last: when destroying |
146 // other members, especially the worker pool, we may check the code is running | 152 // other members, especially the worker pool, we may check the code is running |
147 // on the correct thread. | 153 // on the correct thread. |
148 ThreadChecker thread_checker_; | 154 ThreadChecker thread_checker_; |
149 | 155 |
150 TestLauncherDelegate* launcher_delegate_; | 156 TestLauncherDelegate* launcher_delegate_; |
151 | 157 |
158 bool use_child_gtest_output_; | |
159 | |
152 // Support for outer sharding, just like gtest does. | 160 // Support for outer sharding, just like gtest does. |
153 int32 total_shards_; // Total number of outer shards, at least one. | 161 int32 total_shards_; // Total number of outer shards, at least one. |
154 int32 shard_index_; // Index of shard the launcher is to run. | 162 int32 shard_index_; // Index of shard the launcher is to run. |
155 | 163 |
156 int cycles_; // Number of remaining test itreations, or -1 for infinite. | 164 int cycles_; // Number of remaining test itreations, or -1 for infinite. |
157 | 165 |
158 // Test filters (empty means no filter). | 166 // Test filters (empty means no filter). |
159 std::vector<std::string> positive_test_filter_; | 167 std::vector<std::string> positive_test_filter_; |
160 std::vector<std::string> negative_test_filter_; | 168 std::vector<std::string> negative_test_filter_; |
161 | 169 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
201 DISALLOW_COPY_AND_ASSIGN(TestLauncher); | 209 DISALLOW_COPY_AND_ASSIGN(TestLauncher); |
202 }; | 210 }; |
203 | 211 |
204 // Extract part from |full_output| that applies to |result|. | 212 // Extract part from |full_output| that applies to |result|. |
205 std::string GetTestOutputSnippet(const TestResult& result, | 213 std::string GetTestOutputSnippet(const TestResult& result, |
206 const std::string& full_output); | 214 const std::string& full_output); |
207 | 215 |
208 } // namespace base | 216 } // namespace base |
209 | 217 |
210 #endif // BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ | 218 #endif // BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ |
OLD | NEW |