Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: base/test/launcher/test_launcher_ios.cc

Issue 886463003: iOS gtest launcher: retry tests in one big batch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: C++11 Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/test/launcher/unit_test_launcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 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,
133 const std::vector<std::string>& test_names,
134 int launch_flags) override {
135 // Relaunch all tests in one big batch, since overhead of smaller batches
136 // is too big for serialized runs inside ios simulator.
137 RunUnitTestsBatch(test_launcher, this, test_names, launch_flags);
138 }
139
132 private: 140 private:
133 // Directory containing test launcher's executable. 141 // Directory containing test launcher's executable.
134 base::FilePath dir_exe_; 142 base::FilePath dir_exe_;
135 143
136 // Name of the test executable to run. 144 // Name of the test executable to run.
137 std::string test_name_; 145 std::string test_name_;
138 146
139 // Path that launched test binary can write to. 147 // Path that launched test binary can write to.
140 base::FilePath writable_path_; 148 base::FilePath writable_path_;
141 149
(...skipping 28 matching lines...) Expand all
170 // 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.
171 base::TestLauncher launcher(&delegate, 1); 179 base::TestLauncher launcher(&delegate, 1);
172 bool success = launcher.Run(); 180 bool success = launcher.Run();
173 181
174 fprintf(stdout, "Tests took %" PRId64 " seconds.\n", 182 fprintf(stdout, "Tests took %" PRId64 " seconds.\n",
175 (base::TimeTicks::Now() - start_time).InSeconds()); 183 (base::TimeTicks::Now() - start_time).InSeconds());
176 fflush(stdout); 184 fflush(stdout);
177 185
178 return (success ? 0 : 1); 186 return (success ? 0 : 1);
179 } 187 }
OLDNEW
« no previous file with comments | « no previous file | base/test/launcher/unit_test_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698