Skip to content

Commit

Permalink
[IE_TESTS] Avoid any extra work for the skipped tests (openvinotoolki…
Browse files Browse the repository at this point in the history
…t#16915)

i.e. do not clone the function if it is unnecessary
  • Loading branch information
EgorDuplensky authored Apr 13, 2023
1 parent 5299f26 commit a016e4e
Showing 1 changed file with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,26 @@ 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");
}

// 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;
Expand Down

0 comments on commit a016e4e

Please sign in to comment.