From b8360cf3caeb040c033ce43b65105ea5a7d36f66 Mon Sep 17 00:00:00 2001 From: David Horstmann Date: Fri, 31 May 2024 14:38:52 +0100 Subject: [PATCH] Make abi_check.py look in both locations To deal with situations where we are comparing revisions before and after the move of generate_psa_tests.py to the framework, look for it in both the old and new locations. Signed-off-by: David Horstmann --- scripts/abi_check.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/abi_check.py b/scripts/abi_check.py index ec0d4730df..f91d80e504 100755 --- a/scripts/abi_check.py +++ b/scripts/abi_check.py @@ -326,8 +326,14 @@ class AbiChecker: @staticmethod def _list_generated_test_data_files(git_worktree_path): """List the generated test data files.""" + generate_psa_tests = 'framework/scripts/generate_psa_tests.py' + if not os.path.isfile(git_worktree_path + '/' + generate_psa_tests): + # The checked-out revision is from before generate_psa_tests.py + # was moved to the framework submodule. Use the old location. + generate_psa_tests = 'tests/scripts/generate_psa_tests.py' + output = subprocess.check_output( - ['tests/scripts/generate_psa_tests.py', '--list'], + [generate_psa_tests, '--list'], cwd=git_worktree_path, ).decode('ascii') return [line for line in output.split('\n') if line] @@ -353,8 +359,14 @@ class AbiChecker: if 'storage_format' in filename: storage_data_files.add(filename) to_be_generated.add(filename) + + generate_psa_tests = 'framework/scripts/generate_psa_tests.py' + if not os.path.isfile(git_worktree_path + '/' + generate_psa_tests): + # The checked-out revision is from before generate_psa_tests.py + # was moved to the framework submodule. Use the old location. + generate_psa_tests = 'tests/scripts/generate_psa_tests.py' subprocess.check_call( - ['tests/scripts/generate_psa_tests.py'] + sorted(to_be_generated), + [generate_psa_tests] + sorted(to_be_generated), cwd=git_worktree_path, ) for test_file in sorted(storage_data_files):