xref: /aosp_15_r20/external/deqp/executor/xeTestLogParser.hpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1 #ifndef _XETESTLOGPARSER_HPP
2 #define _XETESTLOGPARSER_HPP
3 /*-------------------------------------------------------------------------
4  * drawElements Quality Program Test Executor
5  * ------------------------------------------
6  *
7  * Copyright 2014 The Android Open Source Project
8  *
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
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  *
21  *//*!
22  * \file
23  * \brief Test log parser.
24  *//*--------------------------------------------------------------------*/
25 
26 #include "xeDefs.hpp"
27 #include "xeTestCaseResult.hpp"
28 #include "xeContainerFormatParser.hpp"
29 #include "xeTestResultParser.hpp"
30 #include "xeBatchResult.hpp"
31 
32 #include <string>
33 #include <vector>
34 #include <map>
35 
36 namespace xe
37 {
38 
39 class TestLogHandler
40 {
41 public:
~TestLogHandler(void)42     virtual ~TestLogHandler(void)
43     {
44     }
45 
46     virtual void setSessionInfo(const SessionInfo &sessionInfo) = DE_NULL;
47 
48     virtual TestCaseResultPtr startTestCaseResult(const char *casePath)      = DE_NULL;
49     virtual void testCaseResultUpdated(const TestCaseResultPtr &resultData)  = DE_NULL;
50     virtual void testCaseResultComplete(const TestCaseResultPtr &resultData) = DE_NULL;
51 };
52 
53 class TestLogParser
54 {
55 public:
56     TestLogParser(TestLogHandler *handler);
57     ~TestLogParser(void);
58 
59     void reset(void);
60 
61     void parse(const uint8_t *bytes, size_t numBytes);
62 
63 private:
64     TestLogParser(const TestLogParser &other);
65     TestLogParser &operator=(const TestLogParser &other);
66 
67     ContainerFormatParser m_containerParser;
68     TestLogHandler *m_handler;
69 
70     SessionInfo m_sessionInfo;
71     TestCaseResultPtr m_currentCaseData;
72     bool m_inSession;
73 };
74 
75 } // namespace xe
76 
77 #endif // _XETESTLOGPARSER_HPP
78