1 #ifndef _XETESTRESULTPARSER_HPP
2 #define _XETESTRESULTPARSER_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program Test Executor
5 * ------------------------------------------
7 * Copyright 2014 The Android Open Source Project
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief Test case result parser.
24 *//*--------------------------------------------------------------------*/
27 #include "xeXMLParser.hpp"
28 #include "xeTestCaseResult.hpp"
37 TESTLOGVERSION_0_2_0 = 0,
46 class TestResultParseError : public ParseError
49 TestResultParseError (const std::string& message) : ParseError(message) {}
52 class TestResultParser
57 PARSERESULT_NOT_CHANGED,
65 TestResultParser (void);
66 ~TestResultParser (void);
68 void init (TestCaseResult* dstResult);
69 ParseResult parse (const deUint8* bytes, int numBytes);
72 TestResultParser (const TestResultParser& other);
73 TestResultParser& operator= (const TestResultParser& other);
77 void handleElementStart (void);
78 void handleElementEnd (void);
79 void handleData (void);
81 const char* getAttribute (const char* name);
83 ri::Item* getCurrentItem (void);
84 ri::List* getCurrentItemList (void);
85 void pushItem (ri::Item* item);
87 void updateCurrentItemList (void);
91 STATE_NOT_INITIALIZED = 0,
93 STATE_IN_TEST_CASE_RESULT,
94 STATE_TEST_CASE_RESULT_ENDED,
99 xml::Parser m_xmlParser;
100 TestCaseResult* m_result;
103 TestLogVersion m_logVersion; //!< Only valid in STATE_IN_TEST_CASE_RESULT.
105 std::vector<ri::Item*> m_itemStack;
106 ri::List* m_curItemList;
108 int m_base64DecodeOffset;
110 std::string m_curNumValue;
113 // Helpers exposed to other parsers.
114 TestStatusCode getTestStatusCode (const char* statusCode);
118 class TestCaseResultData;
120 void parseTestCaseResultFromData (TestResultParser* parser, TestCaseResult* result, const TestCaseResultData& data);
124 #endif // _XETESTRESULTPARSER_HPP