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