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

Side by Side Diff: content/public/test/test_launcher.cc

Issue 1262693002: test launcher: print test file names and lines in summary results (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 4 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 | « base/test/launcher/unit_test_launcher.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/test/test_launcher.h" 5 #include "content/public/test/test_launcher.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // wrapping a lower-level test launcher with content-specific code. 113 // wrapping a lower-level test launcher with content-specific code.
114 class WrapperTestLauncherDelegate : public base::TestLauncherDelegate { 114 class WrapperTestLauncherDelegate : public base::TestLauncherDelegate {
115 public: 115 public:
116 explicit WrapperTestLauncherDelegate( 116 explicit WrapperTestLauncherDelegate(
117 content::TestLauncherDelegate* launcher_delegate) 117 content::TestLauncherDelegate* launcher_delegate)
118 : launcher_delegate_(launcher_delegate) { 118 : launcher_delegate_(launcher_delegate) {
119 CHECK(temp_dir_.CreateUniqueTempDir()); 119 CHECK(temp_dir_.CreateUniqueTempDir());
120 } 120 }
121 121
122 // base::TestLauncherDelegate: 122 // base::TestLauncherDelegate:
123 bool GetTests(std::vector<base::SplitTestName>* output) override; 123 bool GetTests(std::vector<base::TestIdentifier>* output) override;
124 bool ShouldRunTest(const std::string& test_case_name, 124 bool ShouldRunTest(const std::string& test_case_name,
125 const std::string& test_name) override; 125 const std::string& test_name) override;
126 size_t RunTests(base::TestLauncher* test_launcher, 126 size_t RunTests(base::TestLauncher* test_launcher,
127 const std::vector<std::string>& test_names) override; 127 const std::vector<std::string>& test_names) override;
128 size_t RetryTests(base::TestLauncher* test_launcher, 128 size_t RetryTests(base::TestLauncher* test_launcher,
129 const std::vector<std::string>& test_names) override; 129 const std::vector<std::string>& test_names) override;
130 130
131 private: 131 private:
132 void DoRunTest(base::TestLauncher* test_launcher, 132 void DoRunTest(base::TestLauncher* test_launcher,
133 const std::string& test_name); 133 const std::string& test_name);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // Store names of all seen tests to properly handle PRE_ tests. 166 // Store names of all seen tests to properly handle PRE_ tests.
167 std::set<std::string> all_test_names_; 167 std::set<std::string> all_test_names_;
168 168
169 // Temporary directory for user data directories. 169 // Temporary directory for user data directories.
170 base::ScopedTempDir temp_dir_; 170 base::ScopedTempDir temp_dir_;
171 171
172 DISALLOW_COPY_AND_ASSIGN(WrapperTestLauncherDelegate); 172 DISALLOW_COPY_AND_ASSIGN(WrapperTestLauncherDelegate);
173 }; 173 };
174 174
175 bool WrapperTestLauncherDelegate::GetTests( 175 bool WrapperTestLauncherDelegate::GetTests(
176 std::vector<base::SplitTestName>* output) { 176 std::vector<base::TestIdentifier>* output) {
177 *output = base::GetCompiledInTests(); 177 *output = base::GetCompiledInTests();
178 return true; 178 return true;
179 } 179 }
180 180
181 bool WrapperTestLauncherDelegate::ShouldRunTest( 181 bool WrapperTestLauncherDelegate::ShouldRunTest(
182 const std::string& test_case_name, 182 const std::string& test_case_name,
183 const std::string& test_name) { 183 const std::string& test_name) {
184 all_test_names_.insert(test_case_name + "." + test_name); 184 all_test_names_.insert(test_case_name + "." + test_name);
185 185
186 if (base::StartsWith(test_name, kManualTestPrefix, 186 if (base::StartsWith(test_name, kManualTestPrefix,
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 509
510 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { 510 TestLauncherDelegate* GetCurrentTestLauncherDelegate() {
511 return g_launcher_delegate; 511 return g_launcher_delegate;
512 } 512 }
513 513
514 ContentMainParams* GetContentMainParams() { 514 ContentMainParams* GetContentMainParams() {
515 return g_params; 515 return g_params;
516 } 516 }
517 517
518 } // namespace content 518 } // namespace content
OLDNEW
« no previous file with comments | « base/test/launcher/unit_test_launcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698