e918e678f68028e9228eb8ea76f733c5a61ec916
[platform/upstream/VK-GL-CTS.git] / external / openglcts / modules / common / glcNoDefaultContextPackage.cpp
1 /*-------------------------------------------------------------------------
2  * OpenGL Conformance Test Suite
3  * -----------------------------
4  *
5  * Copyright (c) 2017 The Khronos Group Inc.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */ /*!
20  * \file
21  * \brief OpenGL Conformance Test Package that does not have predefined GL context.
22  */ /*-------------------------------------------------------------------*/
23
24 #include "glcNoDefaultContextPackage.hpp"
25 #include "glcContextFlagsTests.hpp"
26 #include "glcMultipleContextsTests.hpp"
27 #include "glcNoErrorTests.hpp"
28 #include "glcRobustnessTests.hpp"
29 #include "gluRenderContext.hpp"
30
31 namespace glcts
32 {
33 namespace nodefaultcontext
34 {
35 class TestCaseWrapper : public tcu::TestCaseExecutor
36 {
37 public:
38         TestCaseWrapper(void);
39         ~TestCaseWrapper(void);
40
41         void init(tcu::TestCase* testCase, const std::string& path);
42         void deinit(tcu::TestCase* testCase);
43         tcu::TestNode::IterateResult iterate(tcu::TestCase* testCase);
44 };
45
46 TestCaseWrapper::TestCaseWrapper(void)
47 {
48 }
49
50 TestCaseWrapper::~TestCaseWrapper(void)
51 {
52 }
53
54 void TestCaseWrapper::init(tcu::TestCase* testCase, const std::string&)
55 {
56         testCase->init();
57 }
58
59 void TestCaseWrapper::deinit(tcu::TestCase* testCase)
60 {
61         testCase->deinit();
62 }
63
64 tcu::TestNode::IterateResult TestCaseWrapper::iterate(tcu::TestCase* testCase)
65 {
66         const tcu::TestCase::IterateResult result = testCase->iterate();
67
68         return result;
69 }
70 } // nodefaultcontext
71
72 NoDefaultContextPackage::NoDefaultContextPackage(tcu::TestContext& testCtx, const char* name)
73         : tcu::TestPackage(testCtx, name, "CTS No Default Context Package")
74 {
75 }
76
77 NoDefaultContextPackage::~NoDefaultContextPackage(void)
78 {
79 }
80
81 tcu::TestCaseExecutor* NoDefaultContextPackage::createExecutor(void) const
82 {
83         return new nodefaultcontext::TestCaseWrapper();
84 }
85
86 void NoDefaultContextPackage::init(void)
87 {
88         tcu::TestCaseGroup* gl30Group = new tcu::TestCaseGroup(getTestContext(), "gl30", "");
89         gl30Group->addChild(new glcts::NoErrorTests(getTestContext(), glu::ApiType::core(3, 0)));
90         addChild(gl30Group);
91
92         tcu::TestCaseGroup* gl40Group = new tcu::TestCaseGroup(getTestContext(), "gl40", "");
93         gl40Group->addChild(new glcts::MultipleContextsTests(getTestContext(), glu::ApiType::core(4, 0)));
94         addChild(gl40Group);
95
96         tcu::TestCaseGroup* gl45Group = new tcu::TestCaseGroup(getTestContext(), "gl45", "");
97         gl45Group->addChild(new glcts::RobustnessTests(getTestContext(), glu::ApiType::core(4, 5)));
98         gl45Group->addChild(new glcts::ContextFlagsTests(getTestContext(), glu::ApiType::core(4, 5)));
99         addChild(gl45Group);
100
101         tcu::TestCaseGroup* es2Group = new tcu::TestCaseGroup(getTestContext(), "es2", "");
102         es2Group->addChild(new glcts::NoErrorTests(getTestContext(), glu::ApiType::es(2, 0)));
103         addChild(es2Group);
104
105         tcu::TestCaseGroup* es32Group = new tcu::TestCaseGroup(getTestContext(), "es32", "");
106         es32Group->addChild(new glcts::RobustnessTests(getTestContext(), glu::ApiType::es(3, 2)));
107         es32Group->addChild(new glcts::ContextFlagsTests(getTestContext(), glu::ApiType::es(3, 2)));
108         addChild(es32Group);
109 }
110
111 } // glcts