From 9f29294a2dc0ccc5413b36a4b89e56adf408b4bc Mon Sep 17 00:00:00 2001 From: Harry Ramsey Date: Wed, 8 Jan 2025 15:41:40 +0000 Subject: [PATCH] Adapt check-doxy-blocks to run for TF-PSA-Crypto This commit adapts check-doxy-blocks to run for TF-PSA-Crypto. Signed-off-by: Harry Ramsey --- scripts/check-doxy-blocks.pl | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/check-doxy-blocks.pl b/scripts/check-doxy-blocks.pl index 3199c2ab4e..24e535152c 100755 --- a/scripts/check-doxy-blocks.pl +++ b/scripts/check-doxy-blocks.pl @@ -16,7 +16,8 @@ use File::Basename; # C/header files in the following directories will be checked -my @directories = qw(include/mbedtls library doxygen/input); +my @mbedtls_directories = qw(include/mbedtls library doxygen/input); +my @tf_psa_crypto_directories = qw(include/psa drivers core doxygen/input); # very naive pattern to find directives: # everything with a backslach except '\0' and backslash at EOL @@ -53,13 +54,18 @@ sub check_dir { } } +open my $project_file, "scripts/project_name.txt" or die "This script must be run from Mbed TLS or TF-PSA-Crypto root directory"; +my $project = <$project_file>; +my @directories; + +if ($project eq "TF-PSA-Crypto") { + @directories = @tf_psa_crypto_directories +} elsif ($project eq "Mbed TLS") { + @directories = @mbedtls_directories +} # Check that the script is being run from the project's root directory. for my $dir (@directories) { - if (! -d $dir) { - die "This script must be run from the Mbed TLS root directory"; - } else { - check_dir($dir) - } + check_dir($dir) } exit $exit_code;