| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 // Called when a test has finished running. | 136 // Called when a test has finished running. |
| 137 void OnTestFinished(const TestResult& result); | 137 void OnTestFinished(const TestResult& result); |
| 138 | 138 |
| 139 private: | 139 private: |
| 140 bool Init() WARN_UNUSED_RESULT; | 140 bool Init() WARN_UNUSED_RESULT; |
| 141 | 141 |
| 142 // Runs all tests in current iteration. Uses callbacks to communicate success. | 142 // Runs all tests in current iteration. Uses callbacks to communicate success. |
| 143 void RunTests(); | 143 void RunTests(); |
| 144 | 144 |
| 145 void CombinePositiveTestFilters(std::vector<std::string> filter_a, |
| 146 std::vector<std::string> filter_b); |
| 147 |
| 145 void RunTestIteration(); | 148 void RunTestIteration(); |
| 146 | 149 |
| 147 // Saves test results summary as JSON if requested from command line. | 150 // Saves test results summary as JSON if requested from command line. |
| 148 void MaybeSaveSummaryAsJSON(const std::vector<std::string>& additional_tags); | 151 void MaybeSaveSummaryAsJSON(const std::vector<std::string>& additional_tags); |
| 149 | 152 |
| 150 // Called on a worker thread after a child process finishes. | 153 // Called on a worker thread after a child process finishes. |
| 151 void OnLaunchTestProcessFinished( | 154 void OnLaunchTestProcessFinished( |
| 152 const GTestProcessCompletedCallback& callback, | 155 const GTestProcessCompletedCallback& callback, |
| 153 int exit_code, | 156 int exit_code, |
| 154 const TimeDelta& elapsed_time, | 157 const TimeDelta& elapsed_time, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 174 | 177 |
| 175 TestLauncherDelegate* launcher_delegate_; | 178 TestLauncherDelegate* launcher_delegate_; |
| 176 | 179 |
| 177 // Support for outer sharding, just like gtest does. | 180 // Support for outer sharding, just like gtest does. |
| 178 int32_t total_shards_; // Total number of outer shards, at least one. | 181 int32_t total_shards_; // Total number of outer shards, at least one. |
| 179 int32_t shard_index_; // Index of shard the launcher is to run. | 182 int32_t shard_index_; // Index of shard the launcher is to run. |
| 180 | 183 |
| 181 int cycles_; // Number of remaining test itreations, or -1 for infinite. | 184 int cycles_; // Number of remaining test itreations, or -1 for infinite. |
| 182 | 185 |
| 183 // Test filters (empty means no filter). | 186 // Test filters (empty means no filter). |
| 187 bool has_at_least_one_positive_filter_; |
| 184 std::vector<std::string> positive_test_filter_; | 188 std::vector<std::string> positive_test_filter_; |
| 185 std::vector<std::string> negative_test_filter_; | 189 std::vector<std::string> negative_test_filter_; |
| 186 | 190 |
| 187 // Tests to use (cached result of TestLauncherDelegate::GetTests). | 191 // Tests to use (cached result of TestLauncherDelegate::GetTests). |
| 188 std::vector<TestIdentifier> tests_; | 192 std::vector<TestIdentifier> tests_; |
| 189 | 193 |
| 190 // Number of tests found in this binary. | 194 // Number of tests found in this binary. |
| 191 size_t test_found_count_; | 195 size_t test_found_count_; |
| 192 | 196 |
| 193 // Number of tests started in this iteration. | 197 // Number of tests started in this iteration. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 DISALLOW_COPY_AND_ASSIGN(TestLauncher); | 239 DISALLOW_COPY_AND_ASSIGN(TestLauncher); |
| 236 }; | 240 }; |
| 237 | 241 |
| 238 // Extract part from |full_output| that applies to |result|. | 242 // Extract part from |full_output| that applies to |result|. |
| 239 std::string GetTestOutputSnippet(const TestResult& result, | 243 std::string GetTestOutputSnippet(const TestResult& result, |
| 240 const std::string& full_output); | 244 const std::string& full_output); |
| 241 | 245 |
| 242 } // namespace base | 246 } // namespace base |
| 243 | 247 |
| 244 #endif // BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ | 248 #endif // BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ |
| OLD | NEW |