1*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
2*35238bceSAndroid Build Coastguard Worker * drawElements Quality Program OpenGL ES 3.1 Module
3*35238bceSAndroid Build Coastguard Worker * -------------------------------------------------
4*35238bceSAndroid Build Coastguard Worker *
5*35238bceSAndroid Build Coastguard Worker * Copyright 2014 The Android Open Source Project
6*35238bceSAndroid Build Coastguard Worker *
7*35238bceSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
8*35238bceSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
9*35238bceSAndroid Build Coastguard Worker * You may obtain a copy of the License at
10*35238bceSAndroid Build Coastguard Worker *
11*35238bceSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0
12*35238bceSAndroid Build Coastguard Worker *
13*35238bceSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
14*35238bceSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
15*35238bceSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16*35238bceSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
17*35238bceSAndroid Build Coastguard Worker * limitations under the License.
18*35238bceSAndroid Build Coastguard Worker *
19*35238bceSAndroid Build Coastguard Worker *//*!
20*35238bceSAndroid Build Coastguard Worker * \file
21*35238bceSAndroid Build Coastguard Worker * \brief OpenGL ES 3.1 Test Package
22*35238bceSAndroid Build Coastguard Worker *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker
24*35238bceSAndroid Build Coastguard Worker #include "tes31TestPackage.hpp"
25*35238bceSAndroid Build Coastguard Worker #include "tes31TestCaseWrapper.hpp"
26*35238bceSAndroid Build Coastguard Worker #include "tes31InfoTests.hpp"
27*35238bceSAndroid Build Coastguard Worker #include "es31fFunctionalTests.hpp"
28*35238bceSAndroid Build Coastguard Worker #include "es31sStressTests.hpp"
29*35238bceSAndroid Build Coastguard Worker #include "gluStateReset.hpp"
30*35238bceSAndroid Build Coastguard Worker #include "gluRenderContext.hpp"
31*35238bceSAndroid Build Coastguard Worker #include "gluContextInfo.hpp"
32*35238bceSAndroid Build Coastguard Worker #include "tcuTestLog.hpp"
33*35238bceSAndroid Build Coastguard Worker #include "tcuCommandLine.hpp"
34*35238bceSAndroid Build Coastguard Worker #include "tcuWaiverUtil.hpp"
35*35238bceSAndroid Build Coastguard Worker #include "glwEnums.hpp"
36*35238bceSAndroid Build Coastguard Worker
37*35238bceSAndroid Build Coastguard Worker namespace deqp
38*35238bceSAndroid Build Coastguard Worker {
39*35238bceSAndroid Build Coastguard Worker namespace gles31
40*35238bceSAndroid Build Coastguard Worker {
41*35238bceSAndroid Build Coastguard Worker
TestPackage(tcu::TestContext & testCtx)42*35238bceSAndroid Build Coastguard Worker TestPackage::TestPackage(tcu::TestContext &testCtx)
43*35238bceSAndroid Build Coastguard Worker : tcu::TestPackage(testCtx, "dEQP-GLES31", "dEQP OpenGL ES 3.1 Tests")
44*35238bceSAndroid Build Coastguard Worker , m_archive(testCtx.getRootArchive(), "gles31/")
45*35238bceSAndroid Build Coastguard Worker , m_context(DE_NULL)
46*35238bceSAndroid Build Coastguard Worker , m_waiverMechanism(new tcu::WaiverUtil)
47*35238bceSAndroid Build Coastguard Worker {
48*35238bceSAndroid Build Coastguard Worker }
49*35238bceSAndroid Build Coastguard Worker
~TestPackage(void)50*35238bceSAndroid Build Coastguard Worker TestPackage::~TestPackage(void)
51*35238bceSAndroid Build Coastguard Worker {
52*35238bceSAndroid Build Coastguard Worker // Destroy children first since destructors may access context.
53*35238bceSAndroid Build Coastguard Worker TestNode::deinit();
54*35238bceSAndroid Build Coastguard Worker delete m_context;
55*35238bceSAndroid Build Coastguard Worker }
56*35238bceSAndroid Build Coastguard Worker
init(void)57*35238bceSAndroid Build Coastguard Worker void TestPackage::init(void)
58*35238bceSAndroid Build Coastguard Worker {
59*35238bceSAndroid Build Coastguard Worker try
60*35238bceSAndroid Build Coastguard Worker {
61*35238bceSAndroid Build Coastguard Worker // Create context
62*35238bceSAndroid Build Coastguard Worker // Some of the tests will test ES3.2 functionality if supported so try to create a 3.2 context
63*35238bceSAndroid Build Coastguard Worker // first. If that doesn't work then create an ES3.1 context.
64*35238bceSAndroid Build Coastguard Worker try
65*35238bceSAndroid Build Coastguard Worker {
66*35238bceSAndroid Build Coastguard Worker m_context = new Context(m_testCtx, glu::ApiType::es(3, 2));
67*35238bceSAndroid Build Coastguard Worker }
68*35238bceSAndroid Build Coastguard Worker catch (...)
69*35238bceSAndroid Build Coastguard Worker {
70*35238bceSAndroid Build Coastguard Worker m_context = new Context(m_testCtx, glu::ApiType::es(3, 1));
71*35238bceSAndroid Build Coastguard Worker }
72*35238bceSAndroid Build Coastguard Worker
73*35238bceSAndroid Build Coastguard Worker // Setup waiver mechanism
74*35238bceSAndroid Build Coastguard Worker if (m_testCtx.getCommandLine().getRunMode() == tcu::RUNMODE_EXECUTE)
75*35238bceSAndroid Build Coastguard Worker {
76*35238bceSAndroid Build Coastguard Worker const glu::ContextInfo &contextInfo = m_context->getContextInfo();
77*35238bceSAndroid Build Coastguard Worker std::string vendor = contextInfo.getString(GL_VENDOR);
78*35238bceSAndroid Build Coastguard Worker std::string renderer = contextInfo.getString(GL_RENDERER);
79*35238bceSAndroid Build Coastguard Worker const tcu::CommandLine &commandLine = m_context->getTestContext().getCommandLine();
80*35238bceSAndroid Build Coastguard Worker tcu::SessionInfo sessionInfo(vendor, renderer, commandLine.getInitialCmdLine());
81*35238bceSAndroid Build Coastguard Worker m_waiverMechanism->setup(commandLine.getWaiverFileName(), m_name, vendor, renderer, sessionInfo);
82*35238bceSAndroid Build Coastguard Worker m_context->getTestContext().getLog().writeSessionInfo(sessionInfo.get());
83*35238bceSAndroid Build Coastguard Worker }
84*35238bceSAndroid Build Coastguard Worker
85*35238bceSAndroid Build Coastguard Worker // Add main test groups
86*35238bceSAndroid Build Coastguard Worker addChild(new InfoTests(*m_context));
87*35238bceSAndroid Build Coastguard Worker addChild(new Functional::GLES31FunctionalTests(*m_context));
88*35238bceSAndroid Build Coastguard Worker addChild(new Stress::StressTests(*m_context));
89*35238bceSAndroid Build Coastguard Worker }
90*35238bceSAndroid Build Coastguard Worker catch (...)
91*35238bceSAndroid Build Coastguard Worker {
92*35238bceSAndroid Build Coastguard Worker delete m_context;
93*35238bceSAndroid Build Coastguard Worker m_context = DE_NULL;
94*35238bceSAndroid Build Coastguard Worker
95*35238bceSAndroid Build Coastguard Worker throw;
96*35238bceSAndroid Build Coastguard Worker }
97*35238bceSAndroid Build Coastguard Worker }
98*35238bceSAndroid Build Coastguard Worker
deinit(void)99*35238bceSAndroid Build Coastguard Worker void TestPackage::deinit(void)
100*35238bceSAndroid Build Coastguard Worker {
101*35238bceSAndroid Build Coastguard Worker TestNode::deinit();
102*35238bceSAndroid Build Coastguard Worker delete m_context;
103*35238bceSAndroid Build Coastguard Worker m_context = DE_NULL;
104*35238bceSAndroid Build Coastguard Worker }
105*35238bceSAndroid Build Coastguard Worker
createExecutor(void) const106*35238bceSAndroid Build Coastguard Worker tcu::TestCaseExecutor *TestPackage::createExecutor(void) const
107*35238bceSAndroid Build Coastguard Worker {
108*35238bceSAndroid Build Coastguard Worker return new TestCaseWrapper<TestPackage>(const_cast<TestPackage &>(*this), m_waiverMechanism);
109*35238bceSAndroid Build Coastguard Worker }
110*35238bceSAndroid Build Coastguard Worker
111*35238bceSAndroid Build Coastguard Worker } // namespace gles31
112*35238bceSAndroid Build Coastguard Worker } // namespace deqp
113