• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 	virtual void				setSessionInfo				(const SessionInfo& sessionInfo)		= DE_NULL;
45 
46 	virtual TestCaseResultPtr	startTestCaseResult			(const char* casePath)					= DE_NULL;
47 	virtual void				testCaseResultUpdated		(const TestCaseResultPtr& resultData)	= DE_NULL;
48 	virtual void				testCaseResultComplete		(const TestCaseResultPtr& resultData)	= DE_NULL;
49 };
50 
51 class TestLogParser
52 {
53 public:
54 							TestLogParser			(TestLogHandler* handler);
55 							~TestLogParser			(void);
56 
57 	void					reset					(void);
58 
59 	void					parse					(const deUint8* bytes, size_t numBytes);
60 
61 private:
62 							TestLogParser			(const TestLogParser& other);
63 	TestLogParser&			operator=				(const TestLogParser& other);
64 
65 	ContainerFormatParser	m_containerParser;
66 	TestLogHandler*			m_handler;
67 
68 	SessionInfo				m_sessionInfo;
69 	TestCaseResultPtr		m_currentCaseData;
70 	bool					m_inSession;
71 };
72 
73 } // xe
74 
75 #endif // _XETESTLOGPARSER_HPP
76