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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 *path = path->AppendASCII("test_results.xml"); | 114 *path = path->AppendASCII("test_results.xml"); |
115 return true; | 115 return true; |
116 } | 116 } |
117 | 117 |
118 base::CommandLine GetCommandLineForChildGTestProcess( | 118 base::CommandLine GetCommandLineForChildGTestProcess( |
119 const std::vector<std::string>& test_names, | 119 const std::vector<std::string>& test_names, |
120 const base::FilePath& output_file) override { | 120 const base::FilePath& output_file) override { |
121 base::CommandLine cmd_line(dir_exe_.AppendASCII(test_name_ + ".app")); | 121 base::CommandLine cmd_line(dir_exe_.AppendASCII(test_name_ + ".app")); |
122 cmd_line.AppendSwitchPath(switches::kTestLauncherOutput, output_file); | 122 cmd_line.AppendSwitchPath(switches::kTestLauncherOutput, output_file); |
123 cmd_line.AppendSwitchASCII(base::kGTestFilterFlag, | 123 cmd_line.AppendSwitchASCII(base::kGTestFilterFlag, |
124 JoinString(test_names, ":")); | 124 base::JoinString(test_names, ":")); |
125 return cmd_line; | 125 return cmd_line; |
126 } | 126 } |
127 | 127 |
128 std::string GetWrapperForChildGTestProcess() override { | 128 std::string GetWrapperForChildGTestProcess() override { |
129 return dir_exe_.AppendASCII("iossim").value(); | 129 return dir_exe_.AppendASCII("iossim").value(); |
130 } | 130 } |
131 | 131 |
132 void RelaunchTests(base::TestLauncher* test_launcher, | 132 void RelaunchTests(base::TestLauncher* test_launcher, |
133 const std::vector<std::string>& test_names, | 133 const std::vector<std::string>& test_names, |
134 int launch_flags) override { | 134 int launch_flags) override { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // Force one job since we can't run multiple simulators in parallel. | 178 // Force one job since we can't run multiple simulators in parallel. |
179 base::TestLauncher launcher(&delegate, 1); | 179 base::TestLauncher launcher(&delegate, 1); |
180 bool success = launcher.Run(); | 180 bool success = launcher.Run(); |
181 | 181 |
182 fprintf(stdout, "Tests took %" PRId64 " seconds.\n", | 182 fprintf(stdout, "Tests took %" PRId64 " seconds.\n", |
183 (base::TimeTicks::Now() - start_time).InSeconds()); | 183 (base::TimeTicks::Now() - start_time).InSeconds()); |
184 fflush(stdout); | 184 fflush(stdout); |
185 | 185 |
186 return (success ? 0 : 1); | 186 return (success ? 0 : 1); |
187 } | 187 } |
OLD | NEW |