提交 e507af2a 编写于 作者: W wangshi

"add vulkan cases commit texture and ubo testcases for vulkan"

Signed-off-by: Nwangshi <wangshi@kaihong.com>
上级 8917cb8a
/*
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <iostream>
#include "tcuPlatform.hpp"
#include "tcuTestContext.hpp"
#include "tcuTestSessionExecutor.hpp"
#include "tcuTestHierarchyUtil.hpp"
#include "tcuCommandLine.hpp"
#include "tcuTestLog.hpp"
#include "qpInfo.h"
#include "qpDebugOut.h"
#include "deMath.h"
#include "ActsApp.h"
namespace tcu {
using std::string;
/*
* \brief Construct test application
*
* If a fatal error occurs during initialization constructor will call
* die() with debug information.
*
* \param platform Reference to platform implementation.
*/
ActsApp::ActsApp (Platform& platform, Archive& archive, TestLog& log, const CommandLine& cmdLine)
: m_platform(platform),
m_watchDog(DE_NULL),
m_crashHandler(DE_NULL),
m_crashed(false),
m_testCtx(DE_NULL),
m_testRoot(DE_NULL),
m_sessionExecutor(DE_NULL)
{
print("dEQP Core %s (0x%08x) starting..\n", qpGetReleaseName(), qpGetReleaseId());
print(" target implementation = '%s'\n", qpGetTargetName());
if (!deSetRoundingMode(DE_ROUNDINGMODE_TO_NEAREST_EVEN)) {
qpPrintf("WARNING: Failed to set floating-point rounding mode!\n");
}
try {
const RunMode runMode = cmdLine.getRunMode();
// Create test context
m_testCtx = new TestContext(m_platform, archive, log, cmdLine, m_watchDog);
// Create root from registry
m_testRoot = new TestPackageRoot(*m_testCtx, TestPackageRegistry::getSingleton());
// \note No executor is created if runmode is not EXECUTE
if (runMode == RUNMODE_EXECUTE) {
m_sessionExecutor = new TestSessionExecutor(*m_testRoot, *m_testCtx);
} else {
DE_ASSERT(false);
}
} catch (const std::exception& e) {
cleanup();
die("Failed to initialize dEQP: %s", e.what());
}
}
ActsApp::~ActsApp (void)
{
cleanup();
}
void ActsApp::cleanup (void)
{
delete m_sessionExecutor;
delete m_testRoot;
delete m_testCtx;
m_sessionExecutor = DE_NULL;
m_testRoot = DE_NULL;
m_testCtx = DE_NULL;
if (m_crashHandler) {
qpCrashHandler_destroy(m_crashHandler);
}
if (m_watchDog) {
qpWatchDog_destroy(m_watchDog);
}
}
/*
* \brief Step forward test execution
* \return true if application should call iterate() again and false
* if test execution session is complete.
*/
bool ActsApp::iterate (void)
{
if (!m_sessionExecutor) {
DE_ASSERT(m_testCtx->getCommandLine().getRunMode() != RUNMODE_EXECUTE);
return false;
}
// Poll platform events
const bool platformOk = m_platform.processEvents();
// Iterate a step.
bool testExecOk = false;
if (platformOk) {
try {
testExecOk = m_sessionExecutor->iterate();
} catch (const std::exception& e) {
die("%s", e.what());
}
}
return platformOk && testExecOk;
}
const TestRunStatus& ActsApp::getResult (void) const
{
return m_sessionExecutor->getStatus();
}
} // tcu
/*
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _ACTSAPP_HPP
#define _ACTSAPP_HPP
#include "tcuDefs.hpp"
#include "qpWatchDog.h"
#include "qpCrashHandler.h"
#include "deMutex.hpp"
#include "tcuTestSessionExecutor.hpp"
#include "tcuTestPackage.hpp"
namespace tcu {
enum class EWATCHDOG {
WATCHDOG_TOTAL_TIME_LIMIT_SECS = 300,
WATCHDOG_INTERVAL_TIME_LIMIT_SECS = 30
};
class ActsApp {
public:
ActsApp (Platform& platform, Archive& archive, TestLog& log, const CommandLine& cmdLine);
virtual ~ActsApp (void);
bool iterate (void);
const TestRunStatus& getResult (void) const;
protected:
void cleanup (void);
Platform& m_platform;
qpWatchDog* m_watchDog;
qpCrashHandler* m_crashHandler;
de::Mutex m_crashLock;
bool m_crashed;
TestContext* m_testCtx;
TestPackageRoot* m_testRoot;
TestSessionExecutor* m_sessionExecutor;
};
} // tcu
#endif // _ACTSAPP_HPP
\ No newline at end of file
/*
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TEST_LOGDEFINE_H
#define TEST_LOGDEFINE_H
#include <cstdio>
#include "tcuDefs.hpp"
#include "tcuCommandLine.hpp"
#include "tcuPlatform.hpp"
#include "ActsApp.h"
#include "tcuResource.hpp"
#include "tcuTestLog.hpp"
#include "tcuTestSessionExecutor.hpp"
#include "deUniquePtr.hpp"
namespace OHOS {
class Logdefine {
public:
static tcu::TestLog tcutestlog;
};
} // OHOS
#endif // TEST_LOGDEFINE_H
\ No newline at end of file
/*
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TEST_SHRINKDEFINE_H
#define TEST_SHRINKDEFINE_H
#define SHRINK_HWTEST_F(TestSuite, TestCase, VkglCase) \
HWTEST_F(TestSuite, TestCase, Function | MediumTest | Level2) \
{ \
GTEST_LOG_(INFO) << #TestCase << "start"; \
int argc = 3; \
const char *argv[3] = { \
".", \
"--deqp-case=" \
VkglCase, \
"--deqp-archive-dir=/data/local/tmp/" \
}; \
FuncRunResult result = RunTestKHRGLES(argc, argv); \
TestSuite::runResult.numPassed += result.numPassed; \
TestSuite::runResult.numFailed += result.numFailed; \
TestSuite::runResult.numNotSupported += result.numNotSupported; \
TestSuite::runResult.numWarnings += result.numWarnings; \
TestSuite::runResult.numWaived += result.numWaived; \
if (result.isComplete) { \
EXPECT_TRUE(result.isComplete); \
if(result.numPassed==1){ \
EXPECT_TRUE(result.numPassed ==1); \
} \
if(result.numNotSupported==1){ \
EXPECT_TRUE(result.numNotSupported==1); \
} \
} \
GTEST_LOG_(INFO) << #TestCase << "end"; \
}
#endif // 为缩减代码而存在
\ No newline at end of file
/*
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TEST_SUITETESTSHRINKHEAD_H
#define TEST_SUITETESTSHRINKHEAD_H
#define SHRINK_SUITETEST_HEAD(TestSuite) \
namespace OHOS { \
class TestSuite : public testing::Test { \
public: \
static time_t startTime; \
static time_t endTime; \
static FuncRunResult runResult; \
protected: \
static void SetUpTestCase(void) \
{ \
time(&startTime); \
RegistPackage(); \
runResult.numPassed = 0; \
runResult.numFailed = 0; \
runResult.numNotSupported = 0; \
runResult.numWarnings = 0; \
runResult.numWaived = 0; \
}; \
static void TearDownTestCase(void) \
{ \
time(&endTime); \
printf("Test run totals --- Passed[%d]\n", runResult.numPassed); \
printf("Test run totals --- Failed[%d]\n", runResult.numFailed); \
printf("Test run totals --- Notsupport[%d]\n", runResult.numNotSupported); \
printf("Test run totals --- Warnings[%d]\n", runResult.numWarnings); \
printf("Test run totals --- Waved[%d]\n", runResult.numWaived); \
std::cout << "testmain end --- COST TIME ["<< (endTime-startTime) << "]" << std::endl; \
}; \
virtual void SetUp(void) {}; \
virtual void TearDown(void) {}; \
}; \
}
#endif // 为缩减代码而存在
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册