Home | History | Annotate | Download | only in gles2
      1 /*-------------------------------------------------------------------------
      2  * drawElements Quality Program OpenGL ES 2.0 Module
      3  * -------------------------------------------------
      4  *
      5  * Copyright 2014 The Android Open Source Project
      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 ES 2.0 Test Package
     22  *//*--------------------------------------------------------------------*/
     23 
     24 #include "tes2TestPackage.hpp"
     25 #include "es2fFunctionalTests.hpp"
     26 #include "es2pPerformanceTests.hpp"
     27 #include "tes2InfoTests.hpp"
     28 #include "tes2CapabilityTests.hpp"
     29 #include "es2aAccuracyTests.hpp"
     30 #include "es2sStressTests.hpp"
     31 
     32 namespace deqp
     33 {
     34 namespace gles2
     35 {
     36 
     37 PackageContext::PackageContext (tcu::TestContext& testCtx)
     38 	: m_context		(DE_NULL)
     39 	, m_caseWrapper	(DE_NULL)
     40 {
     41 	try
     42 	{
     43 		m_context		= new Context(testCtx);
     44 		m_caseWrapper	= new TestCaseWrapper(testCtx, m_context->getRenderContext());
     45 	}
     46 	catch (...)
     47 	{
     48 		delete m_caseWrapper;
     49 		delete m_context;
     50 
     51 		throw;
     52 	}
     53 }
     54 
     55 PackageContext::~PackageContext (void)
     56 {
     57 	delete m_caseWrapper;
     58 	delete m_context;
     59 }
     60 
     61 TestPackage::TestPackage (tcu::TestContext& testCtx)
     62 	: tcu::TestPackage	(testCtx, "dEQP-GLES2", "dEQP OpenGL ES 2.0 Tests")
     63 	, m_packageCtx		(DE_NULL)
     64 	, m_archive			(testCtx.getRootArchive(), "gles2/")
     65 {
     66 }
     67 
     68 TestPackage::~TestPackage (void)
     69 {
     70 	// Destroy children first since destructors may access context.
     71 	TestNode::deinit();
     72 	delete m_packageCtx;
     73 }
     74 
     75 void TestPackage::init (void)
     76 {
     77 	try
     78 	{
     79 		// Create context
     80 		m_packageCtx = new PackageContext(m_testCtx);
     81 
     82 		// Add main test groups
     83 		addChild(new InfoTests						(m_packageCtx->getContext()));
     84 		addChild(new CapabilityTests				(m_packageCtx->getContext()));
     85 		addChild(new Functional::FunctionalTests	(m_packageCtx->getContext()));
     86 		addChild(new Accuracy::AccuracyTests		(m_packageCtx->getContext()));
     87 		addChild(new Performance::PerformanceTests	(m_packageCtx->getContext()));
     88 		addChild(new Stress::StressTests			(m_packageCtx->getContext()));
     89 	}
     90 	catch (...)
     91 	{
     92 		delete m_packageCtx;
     93 		m_packageCtx = DE_NULL;
     94 
     95 		throw;
     96 	}
     97 }
     98 
     99 void TestPackage::deinit (void)
    100 {
    101 	TestNode::deinit();
    102 	delete m_packageCtx;
    103 	m_packageCtx = DE_NULL;
    104 }
    105 
    106 } // gles2
    107 } // deqp
    108