From 78d9d0c1e97a7f99d395189ef8140d0d6a01942d Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Thu, 4 Jul 2019 20:50:11 +0100 Subject: [PATCH] check-names: Consider crypto-sourced header files Many identifiers come from Mbed Crypto. Teach check-names.sh to look in the crypto submodule for identifiers, to avoid incorrect test results. --- tests/scripts/check-names.sh | 2 +- tests/scripts/list-enum-consts.pl | 2 +- tests/scripts/list-identifiers.sh | 4 ++-- tests/scripts/list-macros.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/scripts/check-names.sh b/tests/scripts/check-names.sh index 90ecfd272..60018b5f5 100755 --- a/tests/scripts/check-names.sh +++ b/tests/scripts/check-names.sh @@ -81,7 +81,7 @@ done printf "Likely typos: " sort -u actual-macros enum-consts > _caps -HEADERS=$( ls include/mbedtls/*.h | egrep -v 'compat-1\.3\.h' ) +HEADERS=$( ls include/mbedtls/*.h crypto/include/mbedtls/*.h | egrep -v 'compat-1\.3\.h' ) NL=' ' sed -n 's/MBED..._[A-Z0-9_]*/\'"$NL"'&\'"$NL"/gp \ diff --git a/tests/scripts/list-enum-consts.pl b/tests/scripts/list-enum-consts.pl index 21c25b33e..cfef300a6 100755 --- a/tests/scripts/list-enum-consts.pl +++ b/tests/scripts/list-enum-consts.pl @@ -8,7 +8,7 @@ use open qw(:std utf8); -d 'include/mbedtls' or die "$0: must be run from root\n"; -@ARGV = grep { ! /compat-1\.3\.h/ } ; +@ARGV = grep { ! /compat-1\.3\.h/ } ; my @consts; my $state = 'out'; diff --git a/tests/scripts/list-identifiers.sh b/tests/scripts/list-identifiers.sh index cc9c54fad..0d63284cd 100755 --- a/tests/scripts/list-identifiers.sh +++ b/tests/scripts/list-identifiers.sh @@ -32,9 +32,9 @@ done if [ $INTERNAL ] then - HEADERS=$( ls include/mbedtls/*_internal.h | egrep -v 'compat-1\.3\.h|bn_mul' ) + HEADERS=$( ls include/mbedtls/*_internal.h crypto/include/mbedtls/*_internal.h | egrep -v 'compat-1\.3\.h|bn_mul' ) else - HEADERS=$( ls include/mbedtls/*.h | egrep -v 'compat-1\.3\.h|bn_mul' ) + HEADERS=$( ls include/mbedtls/*.h crypto/include/mbedtls/*.h | egrep -v 'compat-1\.3\.h|bn_mul' ) fi rm -f identifiers diff --git a/tests/scripts/list-macros.sh b/tests/scripts/list-macros.sh index 3c84adba6..4ef057439 100755 --- a/tests/scripts/list-macros.sh +++ b/tests/scripts/list-macros.sh @@ -7,7 +7,7 @@ if [ -d include/mbedtls ]; then :; else exit 1 fi -HEADERS=$( ls include/mbedtls/*.h | egrep -v 'compat-1\.3\.h' ) +HEADERS=$( ls include/mbedtls/*.h crypto/include/mbedtls/*.h | egrep -v 'compat-1\.3\.h' ) sed -n -e 's/.*#define \([a-zA-Z0-9_]*\).*/\1/p' $HEADERS \ | egrep -v '^(asm|inline|EMIT|_CRT_SECURE_NO_DEPRECATE)$|^MULADDC_' \