| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 writable_path_ = base::FilePath(raw_output); | 87 writable_path_ = base::FilePath(raw_output); |
| 88 | 88 |
| 89 return true; | 89 return true; |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool GetTests(std::vector<base::TestIdentifier>* output) override { | 92 bool GetTests(std::vector<base::TestIdentifier>* output) override { |
| 93 base::ScopedTempDir temp_dir; | 93 base::ScopedTempDir temp_dir; |
| 94 if (!temp_dir.CreateUniqueTempDirUnderPath(writable_path_)) | 94 if (!temp_dir.CreateUniqueTempDirUnderPath(writable_path_)) |
| 95 return false; | 95 return false; |
| 96 base::FilePath test_list_path( | 96 base::FilePath test_list_path( |
| 97 temp_dir.path().AppendASCII("test_list.json")); | 97 temp_dir.GetPath().AppendASCII("test_list.json")); |
| 98 | 98 |
| 99 base::CommandLine cmd_line(dir_exe_.AppendASCII(test_name_ + ".app")); | 99 base::CommandLine cmd_line(dir_exe_.AppendASCII(test_name_ + ".app")); |
| 100 cmd_line.AppendSwitchPath(switches::kTestLauncherListTests, test_list_path); | 100 cmd_line.AppendSwitchPath(switches::kTestLauncherListTests, test_list_path); |
| 101 cmd_line.PrependWrapper(dir_exe_.AppendASCII("iossim").value()); | 101 cmd_line.PrependWrapper(dir_exe_.AppendASCII("iossim").value()); |
| 102 | 102 |
| 103 base::LaunchOptions launch_options; | 103 base::LaunchOptions launch_options; |
| 104 launch_options.wait = true; | 104 launch_options.wait = true; |
| 105 | 105 |
| 106 if (!base::LaunchProcess(cmd_line, launch_options).IsValid()) | 106 if (!base::LaunchProcess(cmd_line, launch_options).IsValid()) |
| 107 return false; | 107 return false; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // Force one job since we can't run multiple simulators in parallel. | 179 // Force one job since we can't run multiple simulators in parallel. |
| 180 base::TestLauncher launcher(&delegate, 1); | 180 base::TestLauncher launcher(&delegate, 1); |
| 181 bool success = launcher.Run(); | 181 bool success = launcher.Run(); |
| 182 | 182 |
| 183 fprintf(stdout, "Tests took %" PRId64 " seconds.\n", | 183 fprintf(stdout, "Tests took %" PRId64 " seconds.\n", |
| 184 (base::TimeTicks::Now() - start_time).InSeconds()); | 184 (base::TimeTicks::Now() - start_time).InSeconds()); |
| 185 fflush(stdout); | 185 fflush(stdout); |
| 186 | 186 |
| 187 return (success ? 0 : 1); | 187 return (success ? 0 : 1); |
| 188 } | 188 } |
| OLD | NEW |