OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |