• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _TCUTESTSESSIONEXECUTOR_HPP
2 #define _TCUTESTSESSIONEXECUTOR_HPP
3 /*-------------------------------------------------------------------------
4  * drawElements Quality Program Tester Core
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 executor.
24  *//*--------------------------------------------------------------------*/
25 
26 #include "tcuDefs.hpp"
27 #include "tcuTestContext.hpp"
28 #include "tcuTestCase.hpp"
29 #include "tcuTestPackage.hpp"
30 #include "tcuTestHierarchyIterator.hpp"
31 #include "deUniquePtr.hpp"
32 #include <map>
33 
34 namespace tcu
35 {
36 
37 class TestSessionExecutor
38 {
39 public:
40 									TestSessionExecutor	(TestPackageRoot& root, TestContext& testCtx);
41 									~TestSessionExecutor(void);
42 
43 	bool							iterate						(void);
44 
isInTestCase(void) const45 	bool							isInTestCase				(void) const { return m_isInTestCase;	}
getStatus(void) const46 	const TestRunStatus&			getStatus					(void) const { return m_status;			}
47 
48 private:
49 	void							enterTestPackage			(TestPackage* testPackage);
50 	void							leaveTestPackage			(TestPackage* testPackage);
51 
52 	void							enterTestGroup				(const std::string& casePath);
53 	void							leaveTestGroup				(const std::string& casePath);
54 
55 	bool							enterTestCase				(TestCase* testCase, const std::string& casePath);
56 	TestCase::IterateResult			iterateTestCase				(TestCase* testCase);
57 	void							leaveTestCase				(TestCase* testCase);
58 
59 	enum State
60 	{
61 		STATE_TRAVERSE_HIERARCHY = 0,
62 		STATE_EXECUTE_TEST_CASE,
63 
64 		STATE_LAST
65 	};
66 
67 	TestContext&					m_testCtx;
68 
69 	DefaultHierarchyInflater		m_inflater;
70 	de::MovePtr<CaseListFilter>		m_caseListFilter;
71 	TestHierarchyIterator			m_iterator;
72 
73 	de::MovePtr<TestCaseExecutor>	m_caseExecutor;
74 	TestRunStatus					m_status;
75 	State							m_state;
76 	bool							m_abortSession;
77 	bool							m_isInTestCase;
78 	deUint64						m_testStartTime;
79 	deUint64						m_packageStartTime;
80 	std::map<std::string, deUint64>	m_groupsDurationTime;
81 };
82 
83 } // tcu
84 
85 #endif // _TCUTESTSESSIONEXECUTOR_HPP
86