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

Side by Side Diff: base/test/gtest_xml_util.cc

Issue 418093004: Factored out duplicate code for formatting full test name (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed bug Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/test/launcher/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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/gtest_xml_util.h" 5 #include "base/test/gtest_xml_util.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/test/launcher/test_launcher.h" 10 #include "base/test/launcher/test_launcher.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // This is our custom extension that helps recognize which test was 139 // This is our custom extension that helps recognize which test was
140 // running when the test binary crashed. 140 // running when the test binary crashed.
141 TestResult result; 141 TestResult result;
142 142
143 std::string test_case_name; 143 std::string test_case_name;
144 if (!xml_reader.NodeAttribute("classname", &test_case_name)) 144 if (!xml_reader.NodeAttribute("classname", &test_case_name))
145 return false; 145 return false;
146 std::string test_name; 146 std::string test_name;
147 if (!xml_reader.NodeAttribute("name", &test_name)) 147 if (!xml_reader.NodeAttribute("name", &test_name))
148 return false; 148 return false;
149 result.full_name = test_case_name + "." + test_name; 149 result.full_name = TestLauncher::FormatFullTestName(test_case_name,
150 test_name);
150 151
151 result.elapsed_time = TimeDelta(); 152 result.elapsed_time = TimeDelta();
152 153
153 // Assume the test crashed - we can correct that later. 154 // Assume the test crashed - we can correct that later.
154 result.status = TestResult::TEST_CRASH; 155 result.status = TestResult::TEST_CRASH;
155 156
156 results->push_back(result); 157 results->push_back(result);
157 } else if (node_name == "testcase" && !xml_reader.IsClosingElement()) { 158 } else if (node_name == "testcase" && !xml_reader.IsClosingElement()) {
158 std::string test_status; 159 std::string test_status;
159 if (!xml_reader.NodeAttribute("status", &test_status)) 160 if (!xml_reader.NodeAttribute("status", &test_status))
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // format. 220 // format.
220 return false; 221 return false;
221 } 222 }
222 } 223 }
223 224
224 *crashed = (state != STATE_END); 225 *crashed = (state != STATE_END);
225 return true; 226 return true;
226 } 227 }
227 228
228 } // namespace base 229 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/test/launcher/test_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698