xref: /aosp_15_r20/external/deqp/modules/egl/teglTestPackage.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
2*35238bceSAndroid Build Coastguard Worker  * drawElements Quality Program EGL 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 EGL Test Package
22*35238bceSAndroid Build Coastguard Worker  *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker 
24*35238bceSAndroid Build Coastguard Worker #include "teglTestPackage.hpp"
25*35238bceSAndroid Build Coastguard Worker 
26*35238bceSAndroid Build Coastguard Worker #include "tcuTestLog.hpp"
27*35238bceSAndroid Build Coastguard Worker #include "tcuPlatform.hpp"
28*35238bceSAndroid Build Coastguard Worker #include "tcuCommandLine.hpp"
29*35238bceSAndroid Build Coastguard Worker 
30*35238bceSAndroid Build Coastguard Worker #include "egluPlatform.hpp"
31*35238bceSAndroid Build Coastguard Worker #include "egluUtil.hpp"
32*35238bceSAndroid Build Coastguard Worker 
33*35238bceSAndroid Build Coastguard Worker #include "teglInfoTests.hpp"
34*35238bceSAndroid Build Coastguard Worker #include "teglCreateContextTests.hpp"
35*35238bceSAndroid Build Coastguard Worker #include "teglQueryContextTests.hpp"
36*35238bceSAndroid Build Coastguard Worker #include "teglCreateSurfaceTests.hpp"
37*35238bceSAndroid Build Coastguard Worker #include "teglQuerySurfaceTests.hpp"
38*35238bceSAndroid Build Coastguard Worker #include "teglChooseConfigTests.hpp"
39*35238bceSAndroid Build Coastguard Worker #include "teglQueryConfigTests.hpp"
40*35238bceSAndroid Build Coastguard Worker #include "teglColorClearTests.hpp"
41*35238bceSAndroid Build Coastguard Worker #include "teglRenderTests.hpp"
42*35238bceSAndroid Build Coastguard Worker #include "teglImageTests.hpp"
43*35238bceSAndroid Build Coastguard Worker #include "teglGLES2SharingTests.hpp"
44*35238bceSAndroid Build Coastguard Worker #include "teglNegativeApiTests.hpp"
45*35238bceSAndroid Build Coastguard Worker #include "teglSyncTests.hpp"
46*35238bceSAndroid Build Coastguard Worker #include "teglMultiThreadTests.hpp"
47*35238bceSAndroid Build Coastguard Worker #include "teglGetProcAddressTests.hpp"
48*35238bceSAndroid Build Coastguard Worker #include "teglMemoryStressTests.hpp"
49*35238bceSAndroid Build Coastguard Worker #include "teglMakeCurrentPerfTests.hpp"
50*35238bceSAndroid Build Coastguard Worker #include "teglGLES2SharedRenderingPerfTests.hpp"
51*35238bceSAndroid Build Coastguard Worker #include "teglPreservingSwapTests.hpp"
52*35238bceSAndroid Build Coastguard Worker #include "teglClientExtensionTests.hpp"
53*35238bceSAndroid Build Coastguard Worker #include "teglCreateContextExtTests.hpp"
54*35238bceSAndroid Build Coastguard Worker #include "teglSurfacelessContextTests.hpp"
55*35238bceSAndroid Build Coastguard Worker #include "teglSwapBuffersTests.hpp"
56*35238bceSAndroid Build Coastguard Worker #include "teglNativeColorMappingTests.hpp"
57*35238bceSAndroid Build Coastguard Worker #include "teglNativeCoordMappingTests.hpp"
58*35238bceSAndroid Build Coastguard Worker #include "teglResizeTests.hpp"
59*35238bceSAndroid Build Coastguard Worker #include "teglBufferAgeTests.hpp"
60*35238bceSAndroid Build Coastguard Worker #include "teglPartialUpdateTests.hpp"
61*35238bceSAndroid Build Coastguard Worker #include "teglNegativePartialUpdateTests.hpp"
62*35238bceSAndroid Build Coastguard Worker #include "teglSwapBuffersWithDamageTests.hpp"
63*35238bceSAndroid Build Coastguard Worker #include "teglMultiContextTests.hpp"
64*35238bceSAndroid Build Coastguard Worker #include "teglThreadCleanUpTests.hpp"
65*35238bceSAndroid Build Coastguard Worker #include "teglMutableRenderBufferTests.hpp"
66*35238bceSAndroid Build Coastguard Worker #include "teglGetFrameTimestampsTests.hpp"
67*35238bceSAndroid Build Coastguard Worker #include "teglRobustnessTests.hpp"
68*35238bceSAndroid Build Coastguard Worker #include "teglWideColorTests.hpp"
69*35238bceSAndroid Build Coastguard Worker 
70*35238bceSAndroid Build Coastguard Worker namespace deqp
71*35238bceSAndroid Build Coastguard Worker {
72*35238bceSAndroid Build Coastguard Worker namespace egl
73*35238bceSAndroid Build Coastguard Worker {
74*35238bceSAndroid Build Coastguard Worker 
75*35238bceSAndroid Build Coastguard Worker class StressTests : public TestCaseGroup
76*35238bceSAndroid Build Coastguard Worker {
77*35238bceSAndroid Build Coastguard Worker public:
StressTests(EglTestContext & eglTestCtx)78*35238bceSAndroid Build Coastguard Worker     StressTests(EglTestContext &eglTestCtx) : TestCaseGroup(eglTestCtx, "stress", "EGL stress tests")
79*35238bceSAndroid Build Coastguard Worker     {
80*35238bceSAndroid Build Coastguard Worker     }
81*35238bceSAndroid Build Coastguard Worker 
init(void)82*35238bceSAndroid Build Coastguard Worker     void init(void)
83*35238bceSAndroid Build Coastguard Worker     {
84*35238bceSAndroid Build Coastguard Worker         addChild(new MemoryStressTests(m_eglTestCtx));
85*35238bceSAndroid Build Coastguard Worker     }
86*35238bceSAndroid Build Coastguard Worker };
87*35238bceSAndroid Build Coastguard Worker 
88*35238bceSAndroid Build Coastguard Worker class PerformanceTests : public TestCaseGroup
89*35238bceSAndroid Build Coastguard Worker {
90*35238bceSAndroid Build Coastguard Worker public:
PerformanceTests(EglTestContext & eglTestCtx)91*35238bceSAndroid Build Coastguard Worker     PerformanceTests(EglTestContext &eglTestCtx) : TestCaseGroup(eglTestCtx, "performance", "EGL performance tests")
92*35238bceSAndroid Build Coastguard Worker     {
93*35238bceSAndroid Build Coastguard Worker     }
94*35238bceSAndroid Build Coastguard Worker 
init(void)95*35238bceSAndroid Build Coastguard Worker     void init(void)
96*35238bceSAndroid Build Coastguard Worker     {
97*35238bceSAndroid Build Coastguard Worker         addChild(new MakeCurrentPerfTests(m_eglTestCtx));
98*35238bceSAndroid Build Coastguard Worker         addChild(new GLES2SharedRenderingPerfTests(m_eglTestCtx));
99*35238bceSAndroid Build Coastguard Worker     }
100*35238bceSAndroid Build Coastguard Worker };
101*35238bceSAndroid Build Coastguard Worker 
102*35238bceSAndroid Build Coastguard Worker class FunctionalTests : public TestCaseGroup
103*35238bceSAndroid Build Coastguard Worker {
104*35238bceSAndroid Build Coastguard Worker public:
FunctionalTests(EglTestContext & eglTestCtx)105*35238bceSAndroid Build Coastguard Worker     FunctionalTests(EglTestContext &eglTestCtx) : TestCaseGroup(eglTestCtx, "functional", "EGL functional tests")
106*35238bceSAndroid Build Coastguard Worker     {
107*35238bceSAndroid Build Coastguard Worker     }
108*35238bceSAndroid Build Coastguard Worker 
init(void)109*35238bceSAndroid Build Coastguard Worker     void init(void)
110*35238bceSAndroid Build Coastguard Worker     {
111*35238bceSAndroid Build Coastguard Worker         addChild(new CreateContextTests(m_eglTestCtx));
112*35238bceSAndroid Build Coastguard Worker         addChild(new QueryContextTests(m_eglTestCtx));
113*35238bceSAndroid Build Coastguard Worker         addChild(new CreateSurfaceTests(m_eglTestCtx));
114*35238bceSAndroid Build Coastguard Worker         addChild(new QuerySurfaceTests(m_eglTestCtx));
115*35238bceSAndroid Build Coastguard Worker         addChild(new QueryConfigTests(m_eglTestCtx));
116*35238bceSAndroid Build Coastguard Worker         addChild(new ChooseConfigTests(m_eglTestCtx));
117*35238bceSAndroid Build Coastguard Worker         addChild(new ColorClearTests(m_eglTestCtx));
118*35238bceSAndroid Build Coastguard Worker         addChild(new RenderTests(m_eglTestCtx));
119*35238bceSAndroid Build Coastguard Worker         addChild(new ImageTests(m_eglTestCtx));
120*35238bceSAndroid Build Coastguard Worker         addChild(new SharingTests(m_eglTestCtx));
121*35238bceSAndroid Build Coastguard Worker         addChild(new NegativeApiTests(m_eglTestCtx));
122*35238bceSAndroid Build Coastguard Worker         addChild(new FenceSyncTests(m_eglTestCtx));
123*35238bceSAndroid Build Coastguard Worker         addChild(new MultiThreadedTests(m_eglTestCtx));
124*35238bceSAndroid Build Coastguard Worker         addChild(new GetProcAddressTests(m_eglTestCtx));
125*35238bceSAndroid Build Coastguard Worker         addChild(new PreservingSwapTests(m_eglTestCtx));
126*35238bceSAndroid Build Coastguard Worker         addChild(new ClientExtensionTests(m_eglTestCtx));
127*35238bceSAndroid Build Coastguard Worker         addChild(new CreateContextExtTests(m_eglTestCtx));
128*35238bceSAndroid Build Coastguard Worker         addChild(new SurfacelessContextTests(m_eglTestCtx));
129*35238bceSAndroid Build Coastguard Worker         addChild(new SwapBuffersTests(m_eglTestCtx));
130*35238bceSAndroid Build Coastguard Worker         addChild(new NativeColorMappingTests(m_eglTestCtx));
131*35238bceSAndroid Build Coastguard Worker         addChild(new NativeCoordMappingTests(m_eglTestCtx));
132*35238bceSAndroid Build Coastguard Worker         addChild(new ReusableSyncTests(m_eglTestCtx));
133*35238bceSAndroid Build Coastguard Worker         addChild(new ResizeTests(m_eglTestCtx));
134*35238bceSAndroid Build Coastguard Worker         addChild(new BufferAgeTests(m_eglTestCtx));
135*35238bceSAndroid Build Coastguard Worker         addChild(new PartialUpdateTests(m_eglTestCtx));
136*35238bceSAndroid Build Coastguard Worker         addChild(new NegativePartialUpdateTests(m_eglTestCtx));
137*35238bceSAndroid Build Coastguard Worker         addChild(new SwapBuffersWithDamageTests(m_eglTestCtx));
138*35238bceSAndroid Build Coastguard Worker         addChild(createMultiContextTests(m_eglTestCtx));
139*35238bceSAndroid Build Coastguard Worker         addChild(createThreadCleanUpTest(m_eglTestCtx));
140*35238bceSAndroid Build Coastguard Worker         addChild(new MutableRenderBufferTests(m_eglTestCtx));
141*35238bceSAndroid Build Coastguard Worker         addChild(createGetFrameTimestampsTests(m_eglTestCtx));
142*35238bceSAndroid Build Coastguard Worker         addChild(createRobustnessTests(m_eglTestCtx));
143*35238bceSAndroid Build Coastguard Worker         addChild(createWideColorTests(m_eglTestCtx));
144*35238bceSAndroid Build Coastguard Worker         addChild(createHdrColorTests(m_eglTestCtx));
145*35238bceSAndroid Build Coastguard Worker     }
146*35238bceSAndroid Build Coastguard Worker };
147*35238bceSAndroid Build Coastguard Worker 
148*35238bceSAndroid Build Coastguard Worker class TestCaseWrapper : public tcu::TestCaseExecutor
149*35238bceSAndroid Build Coastguard Worker {
150*35238bceSAndroid Build Coastguard Worker public:
TestCaseWrapper(void)151*35238bceSAndroid Build Coastguard Worker     TestCaseWrapper(void)
152*35238bceSAndroid Build Coastguard Worker     {
153*35238bceSAndroid Build Coastguard Worker     }
154*35238bceSAndroid Build Coastguard Worker 
~TestCaseWrapper(void)155*35238bceSAndroid Build Coastguard Worker     ~TestCaseWrapper(void)
156*35238bceSAndroid Build Coastguard Worker     {
157*35238bceSAndroid Build Coastguard Worker     }
158*35238bceSAndroid Build Coastguard Worker 
init(tcu::TestCase * testCase,const std::string &)159*35238bceSAndroid Build Coastguard Worker     void init(tcu::TestCase *testCase, const std::string &)
160*35238bceSAndroid Build Coastguard Worker     {
161*35238bceSAndroid Build Coastguard Worker         testCase->init();
162*35238bceSAndroid Build Coastguard Worker     }
163*35238bceSAndroid Build Coastguard Worker 
deinit(tcu::TestCase * testCase)164*35238bceSAndroid Build Coastguard Worker     void deinit(tcu::TestCase *testCase)
165*35238bceSAndroid Build Coastguard Worker     {
166*35238bceSAndroid Build Coastguard Worker         testCase->deinit();
167*35238bceSAndroid Build Coastguard Worker     }
168*35238bceSAndroid Build Coastguard Worker 
iterate(tcu::TestCase * testCase)169*35238bceSAndroid Build Coastguard Worker     tcu::TestNode::IterateResult iterate(tcu::TestCase *testCase)
170*35238bceSAndroid Build Coastguard Worker     {
171*35238bceSAndroid Build Coastguard Worker         return testCase->iterate();
172*35238bceSAndroid Build Coastguard Worker     }
173*35238bceSAndroid Build Coastguard Worker };
174*35238bceSAndroid Build Coastguard Worker 
getDefaultDisplayFactory(tcu::TestContext & testCtx)175*35238bceSAndroid Build Coastguard Worker static const eglu::NativeDisplayFactory &getDefaultDisplayFactory(tcu::TestContext &testCtx)
176*35238bceSAndroid Build Coastguard Worker {
177*35238bceSAndroid Build Coastguard Worker     const eglu::NativeDisplayFactory &factory = eglu::selectNativeDisplayFactory(
178*35238bceSAndroid Build Coastguard Worker         testCtx.getPlatform().getEGLPlatform().getNativeDisplayFactoryRegistry(), testCtx.getCommandLine());
179*35238bceSAndroid Build Coastguard Worker 
180*35238bceSAndroid Build Coastguard Worker     return factory;
181*35238bceSAndroid Build Coastguard Worker }
182*35238bceSAndroid Build Coastguard Worker 
TestPackage(tcu::TestContext & testCtx)183*35238bceSAndroid Build Coastguard Worker TestPackage::TestPackage(tcu::TestContext &testCtx)
184*35238bceSAndroid Build Coastguard Worker     : tcu::TestPackage(testCtx, "dEQP-EGL", "dEQP EGL Tests")
185*35238bceSAndroid Build Coastguard Worker     , m_eglTestCtx(DE_NULL)
186*35238bceSAndroid Build Coastguard Worker {
187*35238bceSAndroid Build Coastguard Worker }
188*35238bceSAndroid Build Coastguard Worker 
~TestPackage(void)189*35238bceSAndroid Build Coastguard Worker TestPackage::~TestPackage(void)
190*35238bceSAndroid Build Coastguard Worker {
191*35238bceSAndroid Build Coastguard Worker     // Destroy children first since destructors may access context.
192*35238bceSAndroid Build Coastguard Worker     TestNode::deinit();
193*35238bceSAndroid Build Coastguard Worker     delete m_eglTestCtx;
194*35238bceSAndroid Build Coastguard Worker }
195*35238bceSAndroid Build Coastguard Worker 
init(void)196*35238bceSAndroid Build Coastguard Worker void TestPackage::init(void)
197*35238bceSAndroid Build Coastguard Worker {
198*35238bceSAndroid Build Coastguard Worker     DE_ASSERT(!m_eglTestCtx);
199*35238bceSAndroid Build Coastguard Worker     m_eglTestCtx = new EglTestContext(m_testCtx, getDefaultDisplayFactory(m_testCtx));
200*35238bceSAndroid Build Coastguard Worker 
201*35238bceSAndroid Build Coastguard Worker     try
202*35238bceSAndroid Build Coastguard Worker     {
203*35238bceSAndroid Build Coastguard Worker         addChild(new InfoTests(*m_eglTestCtx));
204*35238bceSAndroid Build Coastguard Worker         addChild(new FunctionalTests(*m_eglTestCtx));
205*35238bceSAndroid Build Coastguard Worker         addChild(new PerformanceTests(*m_eglTestCtx));
206*35238bceSAndroid Build Coastguard Worker         addChild(new StressTests(*m_eglTestCtx));
207*35238bceSAndroid Build Coastguard Worker     }
208*35238bceSAndroid Build Coastguard Worker     catch (...)
209*35238bceSAndroid Build Coastguard Worker     {
210*35238bceSAndroid Build Coastguard Worker         delete m_eglTestCtx;
211*35238bceSAndroid Build Coastguard Worker         m_eglTestCtx = DE_NULL;
212*35238bceSAndroid Build Coastguard Worker 
213*35238bceSAndroid Build Coastguard Worker         throw;
214*35238bceSAndroid Build Coastguard Worker     }
215*35238bceSAndroid Build Coastguard Worker }
216*35238bceSAndroid Build Coastguard Worker 
deinit(void)217*35238bceSAndroid Build Coastguard Worker void TestPackage::deinit(void)
218*35238bceSAndroid Build Coastguard Worker {
219*35238bceSAndroid Build Coastguard Worker     tcu::TestNode::deinit();
220*35238bceSAndroid Build Coastguard Worker     delete m_eglTestCtx;
221*35238bceSAndroid Build Coastguard Worker     m_eglTestCtx = DE_NULL;
222*35238bceSAndroid Build Coastguard Worker }
223*35238bceSAndroid Build Coastguard Worker 
createExecutor(void) const224*35238bceSAndroid Build Coastguard Worker tcu::TestCaseExecutor *TestPackage::createExecutor(void) const
225*35238bceSAndroid Build Coastguard Worker {
226*35238bceSAndroid Build Coastguard Worker     return new TestCaseWrapper();
227*35238bceSAndroid Build Coastguard Worker }
228*35238bceSAndroid Build Coastguard Worker 
229*35238bceSAndroid Build Coastguard Worker } // namespace egl
230*35238bceSAndroid Build Coastguard Worker } // namespace deqp
231