diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/base/test/gtest_xml_util.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/base/test/gtest_xml_util.cc')
-rw-r--r-- | chromium/base/test/gtest_xml_util.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/chromium/base/test/gtest_xml_util.cc b/chromium/base/test/gtest_xml_util.cc index 1bac5a6b1d2..620d9bafcee 100644 --- a/chromium/base/test/gtest_xml_util.cc +++ b/chromium/base/test/gtest_xml_util.cc @@ -32,6 +32,17 @@ static void XmlErrorFunc(void *context, const char *message, ...) { } // namespace +struct Link { + // The name of the test case. + std::string name; + // The name of the classname of the test. + std::string classname; + // The name of the link. + std::string link_name; + // The actual link. + std::string link; +}; + bool ProcessGTestOutput(const base::FilePath& output_file, std::vector<TestResult>* results, bool* crashed) { @@ -58,6 +69,8 @@ bool ProcessGTestOutput(const base::FilePath& output_file, STATE_END, } state = STATE_INIT; + std::vector<Link> links; + while (xml_reader.Read()) { xml_reader.SkipToElement(); std::string node_name(xml_reader.NodeName()); @@ -137,7 +150,26 @@ bool ProcessGTestOutput(const base::FilePath& output_file, results->pop_back(); } + for (const Link& link : links) { + if (link.name == test_name && link.classname == test_case_name) { + result.AddLink(link.link_name, link.link); + } + } + links.clear(); results->push_back(result); + } else if (node_name == "link" && !xml_reader.IsClosingElement()) { + Link link; + if (!xml_reader.NodeAttribute("name", &link.name)) + return false; + if (!xml_reader.NodeAttribute("classname", &link.classname)) + return false; + if (!xml_reader.NodeAttribute("link_name", &link.link_name)) + return false; + if (!xml_reader.ReadElementContent(&link.link)) + return false; + links.push_back(link); + } else if (node_name == "link" && xml_reader.IsClosingElement()) { + // Deliberately empty. } else if (node_name == "failure" && !xml_reader.IsClosingElement()) { std::string failure_message; if (!xml_reader.NodeAttribute("message", &failure_message)) |