From 45f2a40fa4363bc017937396a04240fb4b320e51 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 6 Jul 2021 21:05:52 +0200 Subject: [PATCH] Speed up the generation of storage format test cases Restore the optimization done in HEAD^{/Speed up the generation of storage format test cases} which was lost during refactoring made when adding support for implicit usage flags. There are still more than one call to the C compiler, but the extra calls are only for some key usage test cases. This is an internal refactoring. This commit does not change the output of generate_psa_tests.py Signed-off-by: Gilles Peskine --- tests/scripts/generate_psa_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/scripts/generate_psa_tests.py b/tests/scripts/generate_psa_tests.py index b59ed749bc..c788ce6d6d 100755 --- a/tests/scripts/generate_psa_tests.py +++ b/tests/scripts/generate_psa_tests.py @@ -495,7 +495,8 @@ class StorageFormat: # test cases. This allows all required information to be obtained in # one go, which is a significant performance gain as the information # includes numerical values obtained by compiling a C program. - for key in self.generate_all_keys(): + all_keys = list(self.generate_all_keys()) + for key in all_keys: if key.location_value() != 0: # Skip keys with a non-default location, because they # require a driver and we currently have no mechanism to