mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-08-07 03:37:49 +00:00
Move _has_word_re to the framework
Signed-off-by: Gilles Peskine <[email protected]>
This commit is contained in:
@@ -16,23 +16,6 @@ from mbedtls_framework import outcome_analysis
|
|||||||
class CoverageTask(outcome_analysis.CoverageTask):
|
class CoverageTask(outcome_analysis.CoverageTask):
|
||||||
"""Justify test cases that are never executed."""
|
"""Justify test cases that are never executed."""
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def _has_word_re(words: typing.Iterable[str],
|
|
||||||
exclude: typing.Optional[str] = None) -> typing.Pattern:
|
|
||||||
"""Construct a regex that matches if any of the words appears.
|
|
||||||
|
|
||||||
The occurrence must start and end at a word boundary.
|
|
||||||
|
|
||||||
If exclude is specified, strings containing a match for that
|
|
||||||
regular expression will not match the returned pattern.
|
|
||||||
"""
|
|
||||||
exclude_clause = r''
|
|
||||||
if exclude:
|
|
||||||
exclude_clause = r'(?!.*' + exclude + ')'
|
|
||||||
return re.compile(exclude_clause +
|
|
||||||
r'.*\b(?:' + r'|'.join(words) + r')\b.*',
|
|
||||||
re.DOTALL)
|
|
||||||
|
|
||||||
UNCOVERED_TESTS = {
|
UNCOVERED_TESTS = {
|
||||||
'ssl-opt': [
|
'ssl-opt': [
|
||||||
# We don't run ssl-opt.sh with Valgrind on the CI because
|
# We don't run ssl-opt.sh with Valgrind on the CI because
|
||||||
|
|||||||
Reference in New Issue
Block a user