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 "glcKHRDebugTests.hpp"
27 #include "glcMultipleContextsTests.hpp"
28 #include "glcNoErrorTests.hpp"
29 #include "glcRobustBufferAccessBehaviorTests.hpp"
30 #include "glcRobustnessTests.hpp"
31 #include "gluRenderContext.hpp"
32
33 namespace glcts
34 {
35 namespace nodefaultcontext
36 {
37 class TestCaseWrapper : public tcu::TestCaseExecutor
38 {
39 public:
40 TestCaseWrapper(void);
41 ~TestCaseWrapper(void);
42
43 void init(tcu::TestCase* testCase, const std::string& path);
44 void deinit(tcu::TestCase* testCase);
45 tcu::TestNode::IterateResult iterate(tcu::TestCase* testCase);
46 };
47
TestCaseWrapper(void)48 TestCaseWrapper::TestCaseWrapper(void)
49 {
50 }
51
~TestCaseWrapper(void)52 TestCaseWrapper::~TestCaseWrapper(void)
53 {
54 }
55
init(tcu::TestCase * testCase,const std::string &)56 void TestCaseWrapper::init(tcu::TestCase* testCase, const std::string&)
57 {
58 testCase->init();
59 }
60
deinit(tcu::TestCase * testCase)61 void TestCaseWrapper::deinit(tcu::TestCase* testCase)
62 {
63 testCase->deinit();
64 }
65
iterate(tcu::TestCase * testCase)66 tcu::TestNode::IterateResult TestCaseWrapper::iterate(tcu::TestCase* testCase)
67 {
68 const tcu::TestCase::IterateResult result = testCase->iterate();
69
70 return result;
71 }
72 } // nodefaultcontext
73
NoDefaultContextPackage(tcu::TestContext & testCtx,const char * name)74 NoDefaultContextPackage::NoDefaultContextPackage(tcu::TestContext& testCtx, const char* name)
75 : tcu::TestPackage(testCtx, name, "CTS No Default Context Package")
76 {
77 }
78
~NoDefaultContextPackage(void)79 NoDefaultContextPackage::~NoDefaultContextPackage(void)
80 {
81 }
82
createExecutor(void) const83 tcu::TestCaseExecutor* NoDefaultContextPackage::createExecutor(void) const
84 {
85 return new nodefaultcontext::TestCaseWrapper();
86 }
87
init(void)88 void NoDefaultContextPackage::init(void)
89 {
90 tcu::TestCaseGroup* gl30Group = new tcu::TestCaseGroup(getTestContext(), "gl30", "");
91 gl30Group->addChild(new glcts::NoErrorTests(getTestContext(), glu::ApiType::core(3, 0)));
92 addChild(gl30Group);
93
94 tcu::TestCaseGroup* gl40Group = new tcu::TestCaseGroup(getTestContext(), "gl40", "");
95 gl40Group->addChild(new glcts::MultipleContextsTests(getTestContext(), glu::ApiType::core(4, 0)));
96 addChild(gl40Group);
97
98 tcu::TestCaseGroup* gl43Group = new tcu::TestCaseGroup(getTestContext(), "gl43", "");
99 gl43Group->addChild(new glcts::RobustBufferAccessBehaviorTests(getTestContext(), glu::ApiType::core(4, 3)));
100 gl43Group->addChild(new glcts::KHRDebugTests(getTestContext(), glu::ApiType::core(4, 3)));
101 addChild(gl43Group);
102
103 tcu::TestCaseGroup* gl45Group = new tcu::TestCaseGroup(getTestContext(), "gl45", "");
104 gl45Group->addChild(new glcts::RobustnessTests(getTestContext(), glu::ApiType::core(4, 5)));
105 gl45Group->addChild(new glcts::ContextFlagsTests(getTestContext(), glu::ApiType::core(4, 5)));
106 addChild(gl45Group);
107
108 tcu::TestCaseGroup* es2Group = new tcu::TestCaseGroup(getTestContext(), "es2", "");
109 es2Group->addChild(new glcts::NoErrorTests(getTestContext(), glu::ApiType::es(2, 0)));
110 addChild(es2Group);
111
112 tcu::TestCaseGroup* es32Group = new tcu::TestCaseGroup(getTestContext(), "es32", "");
113 es32Group->addChild(new glcts::RobustnessTests(getTestContext(), glu::ApiType::es(3, 2)));
114 es32Group->addChild(new glcts::ContextFlagsTests(getTestContext(), glu::ApiType::es(3, 2)));
115 es32Group->addChild(new glcts::RobustBufferAccessBehaviorTests(getTestContext(), glu::ApiType::es(3, 2)));
116 addChild(es32Group);
117 }
118
119 } // glcts
120