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