| 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/launcher/test_launcher.h" | 5 #include "base/test/launcher/test_launcher.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 } | 545 } |
| 546 } else { | 546 } else { |
| 547 OnTestIterationFinished(); | 547 OnTestIterationFinished(); |
| 548 } | 548 } |
| 549 } | 549 } |
| 550 } | 550 } |
| 551 | 551 |
| 552 bool TestLauncher::Init() { | 552 bool TestLauncher::Init() { |
| 553 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 553 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 554 | 554 |
| 555 if (command_line->HasSwitch(kGTestListTestsFlag)) { | |
| 556 // Child gtest processes would list tests instead of running tests. | |
| 557 // TODO(phajdan.jr): Restore support for the flag. | |
| 558 LOG(ERROR) << kGTestListTestsFlag << " is not supported."; | |
| 559 return false; | |
| 560 } | |
| 561 | |
| 562 // Initialize sharding. Command line takes precedence over legacy environment | 555 // Initialize sharding. Command line takes precedence over legacy environment |
| 563 // variables. | 556 // variables. |
| 564 if (command_line->HasSwitch(switches::kTestLauncherTotalShards) && | 557 if (command_line->HasSwitch(switches::kTestLauncherTotalShards) && |
| 565 command_line->HasSwitch(switches::kTestLauncherShardIndex)) { | 558 command_line->HasSwitch(switches::kTestLauncherShardIndex)) { |
| 566 if (!StringToInt( | 559 if (!StringToInt( |
| 567 command_line->GetSwitchValueASCII( | 560 command_line->GetSwitchValueASCII( |
| 568 switches::kTestLauncherTotalShards), | 561 switches::kTestLauncherTotalShards), |
| 569 &total_shards_)) { | 562 &total_shards_)) { |
| 570 LOG(ERROR) << "Invalid value for " << switches::kTestLauncherTotalShards; | 563 LOG(ERROR) << "Invalid value for " << switches::kTestLauncherTotalShards; |
| 571 return false; | 564 return false; |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 | 1004 |
| 1012 g_live_processes.Get().erase(process_handle); | 1005 g_live_processes.Get().erase(process_handle); |
| 1013 } | 1006 } |
| 1014 | 1007 |
| 1015 base::CloseProcessHandle(process_handle); | 1008 base::CloseProcessHandle(process_handle); |
| 1016 | 1009 |
| 1017 return exit_code; | 1010 return exit_code; |
| 1018 } | 1011 } |
| 1019 | 1012 |
| 1020 } // namespace base | 1013 } // namespace base |
| OLD | NEW |