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 2019 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 that runs on GL4.5 context
22*35238bceSAndroid Build Coastguard Worker *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker
24*35238bceSAndroid Build Coastguard Worker #include "tgl45es31TestPackage.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
TestPackageGL45ES31(tcu::TestContext & testCtx)42*35238bceSAndroid Build Coastguard Worker TestPackageGL45ES31::TestPackageGL45ES31(tcu::TestContext &testCtx)
43*35238bceSAndroid Build Coastguard Worker : tcu::TestPackage(testCtx, "dEQP-GL45-ES31", "dEQP OpenGL ES 3.1 Tests On GL4.5 Context")
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
~TestPackageGL45ES31(void)50*35238bceSAndroid Build Coastguard Worker TestPackageGL45ES31::~TestPackageGL45ES31(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 TestPackageGL45ES31::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 m_context = new Context(m_testCtx, glu::ApiType::core(4, 5));
63*35238bceSAndroid Build Coastguard Worker
64*35238bceSAndroid Build Coastguard Worker // Setup waiver mechanism
65*35238bceSAndroid Build Coastguard Worker if (m_testCtx.getCommandLine().getRunMode() == tcu::RUNMODE_EXECUTE)
66*35238bceSAndroid Build Coastguard Worker {
67*35238bceSAndroid Build Coastguard Worker const glu::ContextInfo &contextInfo = m_context->getContextInfo();
68*35238bceSAndroid Build Coastguard Worker std::string vendor = contextInfo.getString(GL_VENDOR);
69*35238bceSAndroid Build Coastguard Worker std::string renderer = contextInfo.getString(GL_RENDERER);
70*35238bceSAndroid Build Coastguard Worker const tcu::CommandLine &commandLine = m_context->getTestContext().getCommandLine();
71*35238bceSAndroid Build Coastguard Worker tcu::SessionInfo sessionInfo(vendor, renderer, commandLine.getInitialCmdLine());
72*35238bceSAndroid Build Coastguard Worker m_waiverMechanism->setup(commandLine.getWaiverFileName(), m_name, vendor, renderer, sessionInfo);
73*35238bceSAndroid Build Coastguard Worker m_context->getTestContext().getLog().writeSessionInfo(sessionInfo.get());
74*35238bceSAndroid Build Coastguard Worker }
75*35238bceSAndroid Build Coastguard Worker
76*35238bceSAndroid Build Coastguard Worker // Add main test groups
77*35238bceSAndroid Build Coastguard Worker addChild(new InfoTests(*m_context));
78*35238bceSAndroid Build Coastguard Worker addChild(new Functional::GL45ES31FunctionalTests(*m_context));
79*35238bceSAndroid Build Coastguard Worker }
80*35238bceSAndroid Build Coastguard Worker catch (...)
81*35238bceSAndroid Build Coastguard Worker {
82*35238bceSAndroid Build Coastguard Worker delete m_context;
83*35238bceSAndroid Build Coastguard Worker m_context = DE_NULL;
84*35238bceSAndroid Build Coastguard Worker
85*35238bceSAndroid Build Coastguard Worker throw;
86*35238bceSAndroid Build Coastguard Worker }
87*35238bceSAndroid Build Coastguard Worker }
88*35238bceSAndroid Build Coastguard Worker
deinit(void)89*35238bceSAndroid Build Coastguard Worker void TestPackageGL45ES31::deinit(void)
90*35238bceSAndroid Build Coastguard Worker {
91*35238bceSAndroid Build Coastguard Worker TestNode::deinit();
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
createExecutor(void) const96*35238bceSAndroid Build Coastguard Worker tcu::TestCaseExecutor *TestPackageGL45ES31::createExecutor(void) const
97*35238bceSAndroid Build Coastguard Worker {
98*35238bceSAndroid Build Coastguard Worker return new TestCaseWrapper<TestPackageGL45ES31>(const_cast<TestPackageGL45ES31 &>(*this), m_waiverMechanism);
99*35238bceSAndroid Build Coastguard Worker }
100*35238bceSAndroid Build Coastguard Worker
101*35238bceSAndroid Build Coastguard Worker } // namespace gles31
102*35238bceSAndroid Build Coastguard Worker } // namespace deqp
103