1f6603c60Sopenharmony_ci/* 2f6603c60Sopenharmony_ci * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. 3f6603c60Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4f6603c60Sopenharmony_ci * you may not use this file except in compliance with the License. 5f6603c60Sopenharmony_ci * You may obtain a copy of the License at 6f6603c60Sopenharmony_ci * 7f6603c60Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8f6603c60Sopenharmony_ci * 9f6603c60Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10f6603c60Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11f6603c60Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12f6603c60Sopenharmony_ci * See the License for the specific language governing permissions and 13f6603c60Sopenharmony_ci * limitations under the License. 14f6603c60Sopenharmony_ci */ 15f6603c60Sopenharmony_ci 16f6603c60Sopenharmony_ci#include <cstdio> 17f6603c60Sopenharmony_ci#include <iostream> 18f6603c60Sopenharmony_ci 19f6603c60Sopenharmony_ci#include "tcuDefs.hpp" 20f6603c60Sopenharmony_ci#include "tcuCommandLine.hpp" 21f6603c60Sopenharmony_ci#include "tcuPlatform.hpp" 22f6603c60Sopenharmony_ci#include "tcuApp.hpp" 23f6603c60Sopenharmony_ci#include "tcuResource.hpp" 24f6603c60Sopenharmony_ci#include "tcuTestLog.hpp" 25f6603c60Sopenharmony_ci#include "tcuTestSessionExecutor.hpp" 26f6603c60Sopenharmony_ci#include "deUniquePtr.hpp" 27f6603c60Sopenharmony_ci#include "tcuOhosPlatform.hpp" 28f6603c60Sopenharmony_ci 29f6603c60Sopenharmony_ci#include "external/openglcts/modules/common/glcConfigPackage.hpp" 30f6603c60Sopenharmony_ci#include "external/openglcts/modules/common/glcSingleConfigTestPackage.hpp" 31f6603c60Sopenharmony_ci#include "external/openglcts/modules/common/glcTestPackage.hpp" 32f6603c60Sopenharmony_ci#include "external/openglcts/modules/gles2/es2cTestPackage.hpp" 33f6603c60Sopenharmony_ci#include "external/openglcts/modules/gles32/es32cTestPackage.hpp" 34f6603c60Sopenharmony_ci#include "external/openglcts/modules/gles31/es31cTestPackage.hpp" 35f6603c60Sopenharmony_ci#include "external/openglcts/modules/gles3/es3cTestPackage.hpp" 36f6603c60Sopenharmony_ci#include "external/openglcts/modules/glesext/esextcTestPackage.hpp" 37f6603c60Sopenharmony_ci 38f6603c60Sopenharmony_ci#include "modules/egl/teglTestPackage.hpp" 39f6603c60Sopenharmony_ci#include "modules/gles2/tes2TestPackage.hpp" 40f6603c60Sopenharmony_ci#include "modules/gles3/tes3TestPackage.hpp" 41f6603c60Sopenharmony_ci#include "modules/gles31/tes31TestPackage.hpp" 42f6603c60Sopenharmony_ci 43f6603c60Sopenharmony_ci#include "ohos_context_i.h" 44f6603c60Sopenharmony_ci#include "logdefine.h" 45f6603c60Sopenharmony_ci#include "EglBaseFunc.h" 46f6603c60Sopenharmony_ci 47f6603c60Sopenharmony_cistatic tcu::TestPackage* createTestPackage(tcu::TestContext& testCtx) 48f6603c60Sopenharmony_ci{ 49f6603c60Sopenharmony_ci return new deqp::egl::TestPackage(testCtx); 50f6603c60Sopenharmony_ci} 51f6603c60Sopenharmony_ci 52f6603c60Sopenharmony_civoid RegistPackage(void) 53f6603c60Sopenharmony_ci{ 54f6603c60Sopenharmony_ci tcu::TestPackageRegistry *registry = tcu::TestPackageRegistry::getSingleton(); 55f6603c60Sopenharmony_ci registry->registerPackage("dEQP-EGL", createTestPackage); 56f6603c60Sopenharmony_ci} 57f6603c60Sopenharmony_ci 58f6603c60Sopenharmony_ci// extern tcu::TestLog tcutestlog; 59f6603c60Sopenharmony_ciFuncRunResult RunTestKHRGLES(int argc, const char** argv) 60f6603c60Sopenharmony_ci{ 61f6603c60Sopenharmony_ci FuncRunResult runResult; 62f6603c60Sopenharmony_ci bool isExist = true; 63f6603c60Sopenharmony_ci try { 64f6603c60Sopenharmony_ci tcu::CommandLine cmdLine(argc, argv); 65f6603c60Sopenharmony_ci tcu::DirArchive archive(cmdLine.getArchiveDir()); 66f6603c60Sopenharmony_ci 67f6603c60Sopenharmony_ci de::UniquePtr<tcu::Platform> platform(createOhosPlatform()); 68f6603c60Sopenharmony_ci de::UniquePtr<tcu::App> app(new tcu::App(*platform, archive, OHOS::Logdefine::tcutestlog, cmdLine)); 69f6603c60Sopenharmony_ci 70f6603c60Sopenharmony_ci for (;isExist;) { 71f6603c60Sopenharmony_ci if (!app->iterate()) { 72f6603c60Sopenharmony_ci isExist = false; 73f6603c60Sopenharmony_ci }; 74f6603c60Sopenharmony_ci }; 75f6603c60Sopenharmony_ci runResult.isComplete = app->getResult().isComplete; 76f6603c60Sopenharmony_ci runResult.numPassed = app->getResult().numPassed; 77f6603c60Sopenharmony_ci runResult.numExecuted = app->getResult().numExecuted; 78f6603c60Sopenharmony_ci runResult.numFailed = app->getResult().numFailed; 79f6603c60Sopenharmony_ci runResult.numNotSupported = app->getResult().numNotSupported; 80f6603c60Sopenharmony_ci runResult.numWarnings = app->getResult().numWarnings; 81f6603c60Sopenharmony_ci runResult.numWaived = app->getResult().numWaived; 82f6603c60Sopenharmony_ci } catch (const std::exception &e) { 83f6603c60Sopenharmony_ci tcu::die("%s", e.what()); 84f6603c60Sopenharmony_ci }; 85f6603c60Sopenharmony_ci return runResult; 86f6603c60Sopenharmony_ci}