Parse test case result version when converting to XML
authorRicardo Garcia <rgarcia@igalia.com>
Fri, 1 Apr 2022 10:01:40 +0000 (12:01 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 7 Apr 2022 17:47:46 +0000 (17:47 +0000)
When parsing QPA files, extract the test case result version so it can
be later used to print the proper version when converting to XML files.

Components: Framework
VK-GL-CTS issue: 3573
VK-GL-CTS public issue: 287

Change-Id: I34d005621685b0ef31a7092ec7c40e6626bf20e3

executor/xeTestCaseResult.hpp
executor/xeTestLogWriter.cpp
executor/xeTestResultParser.cpp

index 1f53607..d588818 100644 (file)
@@ -115,6 +115,7 @@ class TestCaseResultHeader
 public:
                                                TestCaseResultHeader    (void) : caseType(TESTCASETYPE_LAST), statusCode(TESTSTATUSCODE_LAST) {}
 
+       std::string                     caseVersion;                    //!< Test case version.
        std::string                     casePath;                               //!< Full test case path.
        TestCaseType            caseType;                               //!< Test case type.
        TestStatusCode          statusCode;                             //!< Test status code.
index c7e389a..781b376 100644 (file)
@@ -30,8 +30,6 @@
 namespace xe
 {
 
-static const char* TEST_LOG_VERSION = "0.3.3";
-
 /* Batch result writer. */
 
 struct ContainerValue
@@ -502,7 +500,7 @@ void writeTestResult (const TestCaseResult& result, xe::xml::Writer& xmlWriter)
        using xml::Writer;
 
        xmlWriter << Writer::BeginElement("TestCaseResult")
-                         << Writer::Attribute("Version", TEST_LOG_VERSION)
+                         << Writer::Attribute("Version", result.caseVersion)
                          << Writer::Attribute("CasePath", result.casePath)
                          << Writer::Attribute("CaseType", getTestCaseTypeName(result.caseType));
 
index b14e7b2..068f6af 100644 (file)
@@ -464,8 +464,9 @@ void TestResultParser::handleElementStart (void)
                m_logVersion = getTestLogVersion(version);
                // \note Currently assumed that all known log versions are supported.
 
-               m_result->casePath      = getAttribute("CasePath");
-               m_result->caseType      = TESTCASETYPE_SELF_VALIDATE;
+               m_result->caseVersion   = version;
+               m_result->casePath              = getAttribute("CasePath");
+               m_result->caseType              = TESTCASETYPE_SELF_VALIDATE;
 
                if (m_xmlParser.hasAttribute("CaseType"))
                        m_result->caseType = getTestCaseType(m_xmlParser.getAttribute("CaseType"));