Skip to content

Commit

Permalink
psa_test_cases: automatically skip test cases
Browse files Browse the repository at this point in the history
Automatically skip test cases with not-implemented automatic dependencies.

No changes to the generated output.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
  • Loading branch information
gilles-peskine-arm committed Nov 21, 2024
1 parent 8f46e43 commit 26c06c9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions scripts/mbedtls_framework/psa_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,18 @@ def infer_dependencies(self, arguments: List[str]) -> List[str]:
def set_arguments(self, arguments: List[str]) -> None:
"""Set test case arguments and automatically infer dependencies."""
super().set_arguments(arguments)
self.automatic_dependencies.update(self.infer_dependencies(arguments))
dependencies = self.infer_dependencies(arguments)
self.skip_if_any_not_implemented(dependencies)
self.automatic_dependencies.update(dependencies)

def set_dependencies(self, dependencies: List[str]) -> None:
"""Override any previously added automatic or manual dependencies."""
"""Override any previously added automatic or manual dependencies.
Also override any previous instruction to skip the test case.
"""
self.manual_dependencies = dependencies
self.automatic_dependencies.clear()
self.skip_reasons = []

def add_dependencies(self, dependencies: List[str]) -> None:
"""Add manual dependencies."""
Expand All @@ -135,6 +141,5 @@ def get_dependencies(self) -> List[str]:
def skip_if_any_not_implemented(self, dependencies: List[str]) -> None:
"""Skip the test case if any of the given dependencies is not implemented."""
not_implemented = find_dependencies_not_implemented(dependencies)
if not_implemented:
self.skip_because('not implemented: ' +
' '.join(not_implemented))
for dep in not_implemented:
self.skip_because('not implemented: ' + dep)

0 comments on commit 26c06c9

Please sign in to comment.