[IE_TESTS] Avoid any extra work for the skipped tests (#16915)

i.e. do not clone the function if it is unnecessary
This commit is contained in:
Egor Duplenskii
2023-04-13 15:23:38 +02:00
committed by GitHub
parent 5299f26168
commit a016e4e6bb

View File

@@ -24,6 +24,19 @@ LayerTestsCommon::LayerTestsCommon() : threshold(1e-2f), abs_threshold(-1.f) {
}
void LayerTestsCommon::Run() {
bool isCurrentTestDisabled = FuncTestUtils::SkipTestsConfig::currentTestIsDisabled();
ov::test::utils::PassRate::Statuses status = isCurrentTestDisabled ?
ov::test::utils::PassRate::Statuses::SKIPPED :
ov::test::utils::PassRate::Statuses::CRASHED;
auto &s = ov::test::utils::OpSummary::getInstance();
s.setDeviceName(targetDevice);
s.updateOPsStats(function, status);
if (isCurrentTestDisabled)
GTEST_SKIP() << "Disabled test due to configuration" << std::endl;
if (functionRefs == nullptr) {
functionRefs = ngraph::clone_function(*function);
functionRefs->set_friendly_name("refFunction");
@@ -31,15 +44,6 @@ void LayerTestsCommon::Run() {
// in case of crash jump will be made and work will be continued
auto crashHandler = std::unique_ptr<CommonTestUtils::CrashHandler>(new CommonTestUtils::CrashHandler());
auto &s = ov::test::utils::OpSummary::getInstance();
s.setDeviceName(targetDevice);
if (FuncTestUtils::SkipTestsConfig::currentTestIsDisabled()) {
s.updateOPsStats(functionRefs, ov::test::utils::PassRate::Statuses::SKIPPED);
GTEST_SKIP() << "Disabled test due to configuration" << std::endl;
} else {
s.updateOPsStats(functionRefs, ov::test::utils::PassRate::Statuses::CRASHED);
}
// place to jump in case of a crash
int jmpRes = 0;