[IE TESTS] Avoid extra checks for test skipping (#10609)
Avoid double iteration over skip patterns Skip test after first pattern match
This commit is contained in:
parent
94cbbe063b
commit
18ff8afe63
@ -46,12 +46,16 @@ void SubgraphBaseTest::run() {
|
|||||||
#else
|
#else
|
||||||
if (sigsetjmp(CommonTestUtils::env, 1) == 0) {
|
if (sigsetjmp(CommonTestUtils::env, 1) == 0) {
|
||||||
#endif
|
#endif
|
||||||
LayerTestsUtils::PassRate::Statuses status = FuncTestUtils::SkipTestsConfig::currentTestIsDisabled()
|
bool isCurrentTestDisabled = FuncTestUtils::SkipTestsConfig::currentTestIsDisabled();
|
||||||
? LayerTestsUtils::PassRate::Statuses::SKIPPED
|
|
||||||
: LayerTestsUtils::PassRate::Statuses::CRASHED;
|
LayerTestsUtils::PassRate::Statuses status = isCurrentTestDisabled ?
|
||||||
|
LayerTestsUtils::PassRate::Statuses::SKIPPED :
|
||||||
|
LayerTestsUtils::PassRate::Statuses::CRASHED;
|
||||||
summary.setDeviceName(targetDevice);
|
summary.setDeviceName(targetDevice);
|
||||||
summary.updateOPsStats(function, status);
|
summary.updateOPsStats(function, status);
|
||||||
SKIP_IF_CURRENT_TEST_IS_DISABLED();
|
|
||||||
|
if (isCurrentTestDisabled)
|
||||||
|
GTEST_SKIP() << "Disabled test due to configuration" << std::endl;
|
||||||
|
|
||||||
ASSERT_FALSE(targetStaticShapes.empty()) << "Target Static Shape is empty!!!";
|
ASSERT_FALSE(targetStaticShapes.empty()) << "Target Static Shape is empty!!!";
|
||||||
std::string errorMessage;
|
std::string errorMessage;
|
||||||
|
@ -14,15 +14,19 @@ namespace SkipTestsConfig {
|
|||||||
bool disable_tests_skipping = false;
|
bool disable_tests_skipping = false;
|
||||||
|
|
||||||
bool currentTestIsDisabled() {
|
bool currentTestIsDisabled() {
|
||||||
bool skip_test = false;
|
if (disable_tests_skipping)
|
||||||
|
return false;
|
||||||
|
|
||||||
const auto fullName = ::testing::UnitTest::GetInstance()->current_test_info()->test_case_name()
|
const auto fullName = ::testing::UnitTest::GetInstance()->current_test_info()->test_case_name()
|
||||||
+ std::string(".") + ::testing::UnitTest::GetInstance()->current_test_info()->name();
|
+ std::string(".") + ::testing::UnitTest::GetInstance()->current_test_info()->name();
|
||||||
|
|
||||||
for (const auto &pattern : disabledTestPatterns()) {
|
for (const auto &pattern : disabledTestPatterns()) {
|
||||||
std::regex re(pattern);
|
std::regex re(pattern);
|
||||||
if (std::regex_match(fullName, re))
|
if (std::regex_match(fullName, re))
|
||||||
skip_test = true;
|
return true;
|
||||||
}
|
}
|
||||||
return skip_test && !disable_tests_skipping;
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> readSkipTestConfigFiles(const std::vector<std::string>& filePaths) {
|
std::vector<std::string> readSkipTestConfigFiles(const std::vector<std::string>& filePaths) {
|
||||||
|
Loading…
Reference in New Issue
Block a user