| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <inttypes.h> | 5 #include <inttypes.h> |
| 6 #include <stdio.h> | 6 #include <stdio.h> |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 } | 76 } |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 bool CreateTemporaryFile(base::FilePath* path) override { | 79 bool CreateTemporaryFile(base::FilePath* path) override { |
| 80 if (!base::CreateNewTempDirectory(base::FilePath::StringType(), path)) | 80 if (!base::CreateNewTempDirectory(base::FilePath::StringType(), path)) |
| 81 return false; | 81 return false; |
| 82 *path = path->AppendASCII("test_results.xml"); | 82 *path = path->AppendASCII("test_results.xml"); |
| 83 return true; | 83 return true; |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool GetTests(std::vector<base::SplitTestName>* output) override { | 86 bool GetTests(std::vector<base::TestIdentifier>* output) override { |
| 87 base::FilePath output_file; | 87 base::FilePath output_file; |
| 88 if (!base::CreateTemporaryFile(&output_file)) { | 88 if (!base::CreateTemporaryFile(&output_file)) { |
| 89 LOG(ERROR) << "Failed to create a temp file."; | 89 LOG(ERROR) << "Failed to create a temp file."; |
| 90 return false; | 90 return false; |
| 91 } | 91 } |
| 92 | 92 |
| 93 base::CommandLine cmd_line(test_path_); | 93 base::CommandLine cmd_line(test_path_); |
| 94 cmd_line.AppendSwitchPath(switches::kTestLauncherListTests, output_file); | 94 cmd_line.AppendSwitchPath(switches::kTestLauncherListTests, output_file); |
| 95 | 95 |
| 96 base::LaunchOptions launch_options; | 96 base::LaunchOptions launch_options; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 base::TestLauncher launcher(&delegate, base::SysInfo::NumberOfProcessors()); | 151 base::TestLauncher launcher(&delegate, base::SysInfo::NumberOfProcessors()); |
| 152 bool success = launcher.Run(); | 152 bool success = launcher.Run(); |
| 153 | 153 |
| 154 fprintf(stdout, "Tests took %" PRId64 " seconds.\n", | 154 fprintf(stdout, "Tests took %" PRId64 " seconds.\n", |
| 155 (base::TimeTicks::Now() - start_time).InSeconds()); | 155 (base::TimeTicks::Now() - start_time).InSeconds()); |
| 156 fflush(stdout); | 156 fflush(stdout); |
| 157 return success ? 0 : 1; | 157 return success ? 0 : 1; |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace base | 160 } // namespace base |
| OLD | NEW |