From f9aae834a2736fd8079aa2d238dd2504063c6b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 9 Apr 2015 12:20:53 +0200 Subject: [PATCH] Add test for typos in check-names.sh --- tests/scripts/check-names.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/scripts/check-names.sh b/tests/scripts/check-names.sh index bc8b6f6ff..0234b84f7 100755 --- a/tests/scripts/check-names.sh +++ b/tests/scripts/check-names.sh @@ -47,6 +47,25 @@ for THING in identifiers; do fi done +printf "Likely typos: " +sort -u actual-macros enum-consts > _caps +HEADERS=$( ls include/mbedtls/*.h | egrep -v 'compat-1\.3\.h' ) +NL=' +' +sed -n 's/MBEDTLS_[A-Z0-9_]*/\'"$NL"'&\'"$NL"/gp \ + $HEADERS library/*.c \ + | grep MBEDTLS | sort -u > _MBEDTLS_XXX +TYPOS=$( diff _caps _MBEDTLS_XXX | sed -n 's/^> //p' \ + | egrep -v 'XXX|__|_$|^MBEDTLS_CONFIG_FILE$' || true ) +rm _MBEDTLS_XXX _caps +if [ "x$TYPOS" == "x" ]; then + echo "PASS" +else + echo "FAIL" + echo "$TYPOS" + FAIL=1 +fi + if [ "$FAIL" -eq 0 ]; then rm macros actual-macros enum-consts identifiers exported-symbols echo "PASSED"