From 2f62067dfdc1b6a20b270b5dcaffcbad47cf8860 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 | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/check-doxy-blocks.pl b/scripts/check-doxy-blocks.pl index 3199c2ab4..aa121b6fb 100755 --- a/scripts/check-doxy-blocks.pl +++ b/scripts/check-doxy-blocks.pl @@ -16,7 +16,10 @@ use strict; 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 include/tf-psa-crypto + drivers/builtin/include/mbedtls + drivers/builtin/src core doxygen/input); # very naive pattern to find directives: # everything with a backslach except '\0' and backslash at EOL @@ -53,13 +56,19 @@ 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>; +chomp($project); +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;