mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-16 08:42:50 +00:00
Simplify sub-test-suite handling in is_test_case_ignored
No intended behavior change. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
0297605641
commit
dba8010384
@ -136,11 +136,19 @@ class Task:
|
|||||||
def section_name(self) -> str:
|
def section_name(self) -> str:
|
||||||
"""The section name to use in results."""
|
"""The section name to use in results."""
|
||||||
|
|
||||||
def is_test_case_ignored(self, full_test_suite: str, test_string: str) -> bool:
|
def ignored_tests(self, test_suite: str) -> typing.Iterator[IgnoreEntry]:
|
||||||
|
"""Generate the ignore list for the specified test suite."""
|
||||||
|
if test_suite in self.IGNORED_TESTS:
|
||||||
|
yield from self.IGNORED_TESTS[test_suite]
|
||||||
|
pos = test_suite.find('.')
|
||||||
|
if pos != -1:
|
||||||
|
base_test_suite = test_suite[:pos]
|
||||||
|
if base_test_suite in self.IGNORED_TESTS:
|
||||||
|
yield from self.IGNORED_TESTS[base_test_suite]
|
||||||
|
|
||||||
|
def is_test_case_ignored(self, test_suite: str, test_string: str) -> bool:
|
||||||
"""Check if the specified test case is ignored."""
|
"""Check if the specified test case is ignored."""
|
||||||
test_suite = full_test_suite.split('.')[0] # retrieve main part of test suite name
|
for str_or_re in self.ignored_tests(test_suite):
|
||||||
for str_or_re in (self.IGNORED_TESTS.get(full_test_suite, []) +
|
|
||||||
self.IGNORED_TESTS.get(test_suite, [])):
|
|
||||||
if name_matches_pattern(test_string, str_or_re):
|
if name_matches_pattern(test_string, str_or_re):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user