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 #include "base/test/unit_test_launcher.h" | 5 #include "base/test/unit_test_launcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 test_result.test_name = tests[i].test_name; | 278 test_result.test_name = tests[i].test_name; |
279 test_result.status = TestResult::TEST_UNKNOWN; | 279 test_result.status = TestResult::TEST_UNKNOWN; |
280 tests[i].callback.Run(test_result); | 280 tests[i].callback.Run(test_result); |
281 called_any_callback = true; | 281 called_any_callback = true; |
282 } | 282 } |
283 } | 283 } |
284 | 284 |
285 return called_any_callback; | 285 return called_any_callback; |
286 } | 286 } |
287 | 287 |
| 288 ThreadChecker thread_checker_; |
| 289 |
288 ParallelTestLauncher parallel_launcher_; | 290 ParallelTestLauncher parallel_launcher_; |
289 | 291 |
290 // Maximum number of tests to run in a single batch. | 292 // Maximum number of tests to run in a single batch. |
291 size_t batch_limit_; | 293 size_t batch_limit_; |
292 | 294 |
293 std::vector<TestLaunchInfo> tests_; | 295 std::vector<TestLaunchInfo> tests_; |
294 | |
295 ThreadChecker thread_checker_; | |
296 }; | 296 }; |
297 | 297 |
298 bool GetSwitchValueAsInt(const std::string& switch_name, int* result) { | 298 bool GetSwitchValueAsInt(const std::string& switch_name, int* result) { |
299 if (!CommandLine::ForCurrentProcess()->HasSwitch(switch_name)) | 299 if (!CommandLine::ForCurrentProcess()->HasSwitch(switch_name)) |
300 return true; | 300 return true; |
301 | 301 |
302 std::string switch_value = | 302 std::string switch_value = |
303 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switch_name); | 303 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switch_name); |
304 if (!StringToInt(switch_value, result) || *result < 1) { | 304 if (!StringToInt(switch_value, result) || *result < 1) { |
305 LOG(ERROR) << "Invalid value for " << switch_name << ": " << switch_value; | 305 LOG(ERROR) << "Invalid value for " << switch_name << ": " << switch_value; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 | 354 |
355 fprintf(stdout, | 355 fprintf(stdout, |
356 "Tests took %" PRId64 " seconds.\n", | 356 "Tests took %" PRId64 " seconds.\n", |
357 (base::TimeTicks::Now() - start_time).InSeconds()); | 357 (base::TimeTicks::Now() - start_time).InSeconds()); |
358 fflush(stdout); | 358 fflush(stdout); |
359 | 359 |
360 return exit_code; | 360 return exit_code; |
361 } | 361 } |
362 | 362 |
363 } // namespace base | 363 } // namespace base |
OLD | NEW |