Skip to content

Commit 638a6d7

Browse files
fix: make filtering logic for all scenarios
Signed-off-by: Kozlowski, Marek <[email protected]>
1 parent 0f39000 commit 638a6d7

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

source/framework/test_case/test_case_base.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,21 @@ bool TestCaseBase::matchesWithArgFilter(const ArgumentContainer &arguments) cons
8282

8383
bool TestCaseBase::needsToBeFilteredDueToLimitedTargets() const {
8484
const auto *test_info = ::testing::UnitTest::GetInstance()->current_test_info();
85-
const auto full_suite_name = std::string(test_info->test_suite_name());
86-
if (full_suite_name.find("LIMITED/") != std::string::npos) {
87-
const auto pos = full_suite_name.find('/');
88-
if (pos != std::string::npos) {
89-
const auto instantiate_name = full_suite_name.substr(0, pos);
90-
const auto test_class_name = full_suite_name.substr(pos + 1);
91-
if (instantiate_name != test_class_name) {
92-
return !Configuration::get().allowLimitedTests;
85+
if (test_info) {
86+
const auto full_suite_name = std::string(test_info->test_suite_name());
87+
if (full_suite_name.find("LIMITED/") != std::string::npos) {
88+
const auto pos = full_suite_name.find('/');
89+
if (pos != std::string::npos) {
90+
const auto instantiate_name = full_suite_name.substr(0, pos);
91+
const auto test_class_name = full_suite_name.substr(pos + 1);
92+
if (instantiate_name != test_class_name) {
93+
return !Configuration::get().allowLimitedTests;
94+
}
9395
}
9496
}
97+
return Configuration::get().allowLimitedTests;
9598
}
96-
return Configuration::get().allowLimitedTests;
99+
return false;
97100
}
98101

99102
void TestCaseBase::printTestMapWarning() const {

0 commit comments

Comments
 (0)