• 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 #include <iostream>
18 
19 #include "tcuDefs.hpp"
20 #include "tcuCommandLine.hpp"
21 #include "tcuPlatform.hpp"
22 // #include "ActsApp.h"
23 #include "tcuApp.hpp"
24 #include "tcuResource.hpp"
25 #include "tcuTestLog.hpp"
26 #include "tcuTestSessionExecutor.hpp"
27 #include "deUniquePtr.hpp"
28 #include "tcuOhosPlatform.hpp"
29 
30 #include "external/vulkancts/modules/vulkan/vktTestPackage.hpp"
31 
32 #include "logdefine.h"
33 #include "SynchronizationBaseFunc.h"
34 
35 
createTestPackage(tcu::TestContext & testCtx)36 static tcu::TestPackage* createTestPackage (tcu::TestContext& testCtx)
37 {
38 	return new vkt::TestPackage(testCtx);
39 }
40 
createExperimentalTestPackage(tcu::TestContext & testCtx)41 static tcu::TestPackage* createExperimentalTestPackage (tcu::TestContext& testCtx)
42 {
43 	return new vkt::ExperimentalTestPackage(testCtx);
44 }
45 
46 // tcu::TestPackageDescriptor g_vktPackageDescriptor("dEQP-VK", createTestPackage);
47 // tcu::TestPackageDescriptor g_vktExperimentalPackageDescriptor("dEQP-VK-experimental", createExperimentalTestPackage);
48 
RegistPackage(void)49 void RegistPackage(void)
50 {
51     tcu::TestPackageRegistry *registry = tcu::TestPackageRegistry::getSingleton();
52     registry->registerPackage("dEQP-VK", createTestPackage);
53     registry->registerPackage("dEQP-VK-experimental", createExperimentalTestPackage);
54 }
55 
56 
57 // extern tcu::TestLog tcutestlog;
RunTestKHRGLES(int argc,const char ** argv)58 FuncRunResult RunTestKHRGLES(int argc, const char** argv)
59 {
60     FuncRunResult runResult;
61     try {
62         tcu::CommandLine cmdLine(argc, argv);
63         std::cout << "testmain end argc"<< argc << ";" << argv[0] << ";" << argv[1] << ";" << argv[2] << std::endl;
64         tcu::DirArchive archive(cmdLine.getArchiveDir());
65 
66         de::UniquePtr<tcu::Platform> platform(createOhosPlatform());
67         de::UniquePtr<tcu::App> app(new tcu::App(*platform, archive, OHOS::Logdefine::tcutestlog, cmdLine));
68 
69         for (;;) {
70             if (!app->iterate()) {
71                 break;
72             };
73         };
74         runResult.isComplete = app->getResult().isComplete;
75         runResult.numPassed = app->getResult().numPassed;
76         runResult.numExecuted = app->getResult().numExecuted;
77         runResult.numFailed = app->getResult().numFailed;
78         runResult.numNotSupported = app->getResult().numNotSupported;
79         runResult.numWarnings = app->getResult().numWarnings;
80         runResult.numWaived = app->getResult().numWaived;
81     } catch (const std::exception &e) {
82         tcu::die("%s", e.what());
83     };
84     return runResult;
85 }