| 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/unit_test_launcher.h" | 5 #include "base/test/launcher/unit_test_launcher.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 return true; | 114 return true; |
| 115 } | 115 } |
| 116 | 116 |
| 117 CommandLine GetCommandLineForChildGTestProcess( | 117 CommandLine GetCommandLineForChildGTestProcess( |
| 118 const std::vector<std::string>& test_names, | 118 const std::vector<std::string>& test_names, |
| 119 const base::FilePath& output_file) override { | 119 const base::FilePath& output_file) override { |
| 120 CommandLine new_cmd_line(*CommandLine::ForCurrentProcess()); | 120 CommandLine new_cmd_line(*CommandLine::ForCurrentProcess()); |
| 121 | 121 |
| 122 CHECK(temp_dir_.IsValid() || temp_dir_.CreateUniqueTempDir()); | 122 CHECK(temp_dir_.IsValid() || temp_dir_.CreateUniqueTempDir()); |
| 123 FilePath temp_file; | 123 FilePath temp_file; |
| 124 CHECK(CreateTemporaryFileInDir(temp_dir_.path(), &temp_file)); | 124 CHECK(CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file)); |
| 125 std::string long_flags( | 125 std::string long_flags( |
| 126 std::string("--") + kGTestFilterFlag + "=" + | 126 std::string("--") + kGTestFilterFlag + "=" + |
| 127 JoinString(test_names, ":")); | 127 JoinString(test_names, ":")); |
| 128 CHECK_EQ(static_cast<int>(long_flags.size()), | 128 CHECK_EQ(static_cast<int>(long_flags.size()), |
| 129 WriteFile(temp_file, | 129 WriteFile(temp_file, |
| 130 long_flags.data(), | 130 long_flags.data(), |
| 131 static_cast<int>(long_flags.size()))); | 131 static_cast<int>(long_flags.size()))); |
| 132 | 132 |
| 133 new_cmd_line.AppendSwitchPath(switches::kTestLauncherOutput, output_file); | 133 new_cmd_line.AppendSwitchPath(switches::kTestLauncherOutput, output_file); |
| 134 new_cmd_line.AppendSwitchPath(kGTestFlagfileFlag, temp_file); | 134 new_cmd_line.AppendSwitchPath(kGTestFlagfileFlag, temp_file); |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 TestLauncher* test_launcher, | 627 TestLauncher* test_launcher, |
| 628 const std::vector<std::string>& test_names) { | 628 const std::vector<std::string>& test_names) { |
| 629 ThreadTaskRunnerHandle::Get()->PostTask( | 629 ThreadTaskRunnerHandle::Get()->PostTask( |
| 630 FROM_HERE, | 630 FROM_HERE, |
| 631 Bind(&RunUnitTestsSerially, test_launcher, platform_delegate_, test_names, | 631 Bind(&RunUnitTestsSerially, test_launcher, platform_delegate_, test_names, |
| 632 use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0)); | 632 use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0)); |
| 633 return test_names.size(); | 633 return test_names.size(); |
| 634 } | 634 } |
| 635 | 635 |
| 636 } // namespace base | 636 } // namespace base |
| OLD | NEW |