[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user