OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 #if defined(OS_POSIX) | 394 #if defined(OS_POSIX) |
395 if (exit_code != 0) { | 395 if (exit_code != 0) { |
396 // On POSIX, in case the test does not exit cleanly, either due to a crash | 396 // On POSIX, in case the test does not exit cleanly, either due to a crash |
397 // or due to it timing out, we need to clean up any child processes that | 397 // or due to it timing out, we need to clean up any child processes that |
398 // it might have created. On Windows, child processes are automatically | 398 // it might have created. On Windows, child processes are automatically |
399 // cleaned up using JobObjects. | 399 // cleaned up using JobObjects. |
400 base::KillProcessGroup(process_handle); | 400 base::KillProcessGroup(process_handle); |
401 } | 401 } |
402 #endif | 402 #endif |
403 | 403 |
| 404 base::CloseProcessHandle(process_handle); |
| 405 |
404 return exit_code; | 406 return exit_code; |
405 } | 407 } |
406 | 408 |
407 bool RunTests(bool should_shard, int total_shards, int shard_index) { | 409 bool RunTests(bool should_shard, int total_shards, int shard_index) { |
408 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 410 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
409 | 411 |
410 DCHECK(!command_line->HasSwitch(kGTestListTestsFlag)); | 412 DCHECK(!command_line->HasSwitch(kGTestListTestsFlag)); |
411 | 413 |
412 testing::UnitTest* const unit_test = testing::UnitTest::GetInstance(); | 414 testing::UnitTest* const unit_test = testing::UnitTest::GetInstance(); |
413 | 415 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 exit_code = 1; | 628 exit_code = 1; |
627 break; | 629 break; |
628 } | 630 } |
629 | 631 |
630 // Special value "-1" means "repeat indefinitely". | 632 // Special value "-1" means "repeat indefinitely". |
631 if (cycles != -1) | 633 if (cycles != -1) |
632 cycles--; | 634 cycles--; |
633 } | 635 } |
634 return exit_code; | 636 return exit_code; |
635 } | 637 } |
OLD | NEW |