Skip to content

Commit 03091d1

Browse files
author
Nir Sonnenschein
committed
modify check-names.sh and list-macros.sh to work with PSA constants
fixed processing of PSA macros in check names script. This required changes in: *list-macros.sh to scan the PSA headers *check-names to scan PSA files and allow PSA_* macro names
1 parent d668bae commit 03091d1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tests/scripts/check-names.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ diff macros identifiers | sed -n -e 's/< //p' > actual-macros
4040
for THING in actual-macros enum-consts; do
4141
printf "Names of $THING: "
4242
test -r $THING
43-
BAD=$( grep -v '^MBEDTLS_[0-9A-Z_]*[0-9A-Z]$' $THING || true )
43+
BAD=$( grep -E -v '^(MBEDTLS|PSA)_[0-9A-Z_]*[0-9A-Z]$' $THING || true )
4444
if [ "x$BAD" = "x" ]; then
4545
echo "PASS"
4646
else
@@ -65,12 +65,14 @@ done
6565

6666
printf "Likely typos: "
6767
sort -u actual-macros enum-consts > _caps
68-
HEADERS=$( ls include/mbedtls/*.h | egrep -v 'compat-1\.3\.h' )
68+
HEADERS=$( ls include/mbedtls/*.h include/psa/*.h | egrep -v 'compat-1\.3\.h' )
6969
NL='
7070
'
7171
sed -n 's/MBED..._[A-Z0-9_]*/\'"$NL"'&\'"$NL"/gp \
7272
$HEADERS library/*.c \
7373
| grep MBEDTLS | sort -u > _MBEDTLS_XXX
74+
75+
7476
TYPOS=$( diff _caps _MBEDTLS_XXX | sed -n 's/^> //p' \
7577
| egrep -v 'XXX|__|_$|^MBEDTLS_.*CONFIG_FILE$' || true )
7678
rm _MBEDTLS_XXX _caps

tests/scripts/list-macros.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if [ -d include/mbedtls ]; then :; else
77
exit 1
88
fi
99

10-
HEADERS=$( ls include/mbedtls/*.h | egrep -v 'compat-1\.3\.h' )
10+
HEADERS=$( ls include/mbedtls/*.h include/psa/*.h | egrep -v 'compat-1\.3\.h' )
1111

1212
sed -n -e 's/.*#define \([a-zA-Z0-9_]*\).*/\1/p' $HEADERS \
1313
| egrep -v '^(asm|inline|EMIT|_CRT_SECURE_NO_DEPRECATE)$|^MULADDC_' \

0 commit comments

Comments
 (0)