1#ifndef _GLCTESTPACKAGE_HPP
2#define _GLCTESTPACKAGE_HPP
3/*-------------------------------------------------------------------------
4 * OpenGL Conformance Test Suite
5 * -----------------------------
6 *
7 * Copyright (c) 2016 Google Inc.
8 * Copyright (c) 2016 The Khronos Group Inc.
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 *      http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 *
22 */ /*!
23 * \file
24 * \brief OpenGL Conformance Test Package Base Class
25 */ /*-------------------------------------------------------------------*/
26
27#include "glcContext.hpp"
28#include "glcTestCaseWrapper.hpp"
29#include "tcuDefs.hpp"
30#include "tcuResource.hpp"
31#include "tcuTestPackage.hpp"
32#include "deSharedPtr.hpp"
33
34namespace tcu
35{
36	class WaiverUtil;
37}
38
39namespace deqp
40{
41
42class PackageContext
43{
44public:
45	PackageContext(tcu::TestContext& testCtx, glu::ContextType renderContextType);
46	~PackageContext(void);
47
48	Context& getContext(void)
49	{
50		return m_context;
51	}
52	TestCaseWrapper& getTestCaseWrapper(void)
53	{
54		return m_caseWrapper;
55	}
56
57private:
58	Context			m_context;
59	TestCaseWrapper m_caseWrapper;
60};
61
62class TestPackage : public tcu::TestPackage
63{
64public:
65	TestPackage(tcu::TestContext& testCtx, const char* name, const char* description,
66				glu::ContextType renderContextType, const char* resourcesPath);
67	virtual ~TestPackage(void);
68
69	void init(void);
70	void deinit(void);
71
72	TestCaseWrapper& getTestCaseWrapper(void)
73	{
74		return m_packageCtx->getTestCaseWrapper();
75	}
76	tcu::Archive* getArchive(void)
77	{
78		return &m_archive;
79	}
80
81	Context& getContext(void)
82	{
83		return m_packageCtx->getContext();
84	}
85
86protected:
87	de::SharedPtr<tcu::WaiverUtil> m_waiverMechanism;
88
89private:
90	TestPackage(const TestPackage& other);
91	TestPackage& operator=(const TestPackage& other);
92
93	glu::ContextType				m_renderContextType;
94	PackageContext*					m_packageCtx;
95	tcu::ResourcePrefix				m_archive;
96};
97
98} // deqp
99
100#endif // _GLCTESTPACKAGE_HPP
101