From e3f9189103de9f14702fa8f8581457d179d8f0e4 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 21 Nov 2024 16:07:21 +0100 Subject: [PATCH] generate_psa_tests.py: Sort and uniquify dependencies No semantic change. In the generated files, `depends_on:` lines have entries that are reordered. Signed-off-by: Gilles Peskine --- scripts/mbedtls_framework/psa_test_case.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/mbedtls_framework/psa_test_case.py b/scripts/mbedtls_framework/psa_test_case.py index a4ce6a027..c6839b84d 100644 --- a/scripts/mbedtls_framework/psa_test_case.py +++ b/scripts/mbedtls_framework/psa_test_case.py @@ -83,7 +83,12 @@ class TestCase(test_case.TestCase): self.manual_dependencies += dependencies def get_dependencies(self) -> List[str]: - return sorted(self.automatic_dependencies) + self.manual_dependencies + # Make the output independent of the order in which the dependencies + # are calculated by the script. Also avoid duplicates. This makes + # the output robust with respect to refactoring of the scripts. + dependencies = set(self.manual_dependencies) + dependencies.update(self.automatic_dependencies) + return sorted(dependencies) def skip_if_any_not_implemented(self, dependencies: List[str]) -> None: """Skip the test case if any of the given dependencies is not implemented."""