Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: base/test/launcher/test_launcher.h

Issue 2515573003: Make test filters play nice (Closed)
Patch Set: Make test filters play nice Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/test/launcher/test_launcher.cc » ('j') | base/test/launcher/test_launcher.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 CombineTestFilters();
146
145 void RunTestIteration(); 147 void RunTestIteration();
146 148
147 // Saves test results summary as JSON if requested from command line. 149 // Saves test results summary as JSON if requested from command line.
148 void MaybeSaveSummaryAsJSON(const std::vector<std::string>& additional_tags); 150 void MaybeSaveSummaryAsJSON(const std::vector<std::string>& additional_tags);
149 151
150 // Called on a worker thread after a child process finishes. 152 // Called on a worker thread after a child process finishes.
151 void OnLaunchTestProcessFinished( 153 void OnLaunchTestProcessFinished(
152 const GTestProcessCompletedCallback& callback, 154 const GTestProcessCompletedCallback& callback,
153 int exit_code, 155 int exit_code,
154 const TimeDelta& elapsed_time, 156 const TimeDelta& elapsed_time,
(...skipping 19 matching lines...) Expand all
174 176
175 TestLauncherDelegate* launcher_delegate_; 177 TestLauncherDelegate* launcher_delegate_;
176 178
177 // Support for outer sharding, just like gtest does. 179 // Support for outer sharding, just like gtest does.
178 int32_t total_shards_; // Total number of outer shards, at least one. 180 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. 181 int32_t shard_index_; // Index of shard the launcher is to run.
180 182
181 int cycles_; // Number of remaining test itreations, or -1 for infinite. 183 int cycles_; // Number of remaining test itreations, or -1 for infinite.
182 184
183 // Test filters (empty means no filter). 185 // Test filters (empty means no filter).
186 bool has_positive_filter;
Paweł Hajdan Jr. 2016/11/30 12:41:32 nit: All member variables should end with "_". By
katthomas 2016/12/01 00:07:01 We don't _need_ it, but I think it makes the code
187 std::vector<std::string> positive_test_filter_gtest_;
188 std::vector<std::string> positive_test_filter_file_;
184 std::vector<std::string> positive_test_filter_; 189 std::vector<std::string> positive_test_filter_;
190 std::vector<std::string> negative_test_filter_gtest_;
191 std::vector<std::string> negative_test_filter_file_;
185 std::vector<std::string> negative_test_filter_; 192 std::vector<std::string> negative_test_filter_;
186 193
187 // Tests to use (cached result of TestLauncherDelegate::GetTests). 194 // Tests to use (cached result of TestLauncherDelegate::GetTests).
188 std::vector<TestIdentifier> tests_; 195 std::vector<TestIdentifier> tests_;
189 196
190 // Number of tests found in this binary. 197 // Number of tests found in this binary.
191 size_t test_found_count_; 198 size_t test_found_count_;
192 199
193 // Number of tests started in this iteration. 200 // Number of tests started in this iteration.
194 size_t test_started_count_; 201 size_t test_started_count_;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 DISALLOW_COPY_AND_ASSIGN(TestLauncher); 242 DISALLOW_COPY_AND_ASSIGN(TestLauncher);
236 }; 243 };
237 244
238 // Extract part from |full_output| that applies to |result|. 245 // Extract part from |full_output| that applies to |result|.
239 std::string GetTestOutputSnippet(const TestResult& result, 246 std::string GetTestOutputSnippet(const TestResult& result,
240 const std::string& full_output); 247 const std::string& full_output);
241 248
242 } // namespace base 249 } // namespace base
243 250
244 #endif // BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ 251 #endif // BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_
OLDNEW
« no previous file with comments | « no previous file | base/test/launcher/test_launcher.cc » ('j') | base/test/launcher/test_launcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698