diff --git a/tests/scripts/list-enum-consts.pl b/tests/scripts/list-enum-consts.pl index 4e0baec50..bbb949016 100755 --- a/tests/scripts/list-enum-consts.pl +++ b/tests/scripts/list-enum-consts.pl @@ -6,6 +6,8 @@ use strict; use utf8; use open qw(:std utf8); +-d 'include/mbedtls' or die "$0: must be run from root\n"; + @ARGV = ; my @consts; diff --git a/tests/scripts/list-identifiers.sh b/tests/scripts/list-identifiers.sh index 549f213e6..e144cd2e1 100755 --- a/tests/scripts/list-identifiers.sh +++ b/tests/scripts/list-identifiers.sh @@ -2,7 +2,12 @@ set -eu -HEADERS=$( ls include/mbedtls/*.h | egrep -v 'compat-1.2|openssl|bn_mul' ) +if [ -d include/mbedtls ]; then :; else + echo "$0: must be run from root" >&2 + exit 1 +fi + +HEADERS=$( ls include/mbedtls/*.h | egrep -v 'bn_mul' ) rm -f identifiers @@ -22,7 +27,7 @@ if [ $( wc -l < _identifiers ) -eq $( wc -l < _decls ) ]; then egrep -v '^(u?int(16|32|64)_t)$' _identifiers | sort > identifiers rm _identifiers else - echo "Mismatch" 2>&1 + echo "$0: oops, lost some identifiers" 2>&1 exit 1 fi diff --git a/tests/scripts/list-macros.sh b/tests/scripts/list-macros.sh index b19483170..73859467c 100755 --- a/tests/scripts/list-macros.sh +++ b/tests/scripts/list-macros.sh @@ -1,6 +1,11 @@ #!/bin/sh -set =eu +set -eu + +if [ -d include/mbedtls ]; then :; else + echo "$0: must be run from root" >&2 + exit 1 +fi HEADERS=$( ls include/mbedtls/*.h ) diff --git a/tests/scripts/list-symbols.sh b/tests/scripts/list-symbols.sh index 9f10c620f..ad3f84202 100755 --- a/tests/scripts/list-symbols.sh +++ b/tests/scripts/list-symbols.sh @@ -2,8 +2,13 @@ set -eu +if [ -d include/mbedtls ]; then :; else + echo "$0: must be run from root" >&2 + exit 1 +fi + if grep -i cmake Makefile >/dev/null; then - echo "not compatible with cmake" >&2 + echo "$0: not compatible with cmake" >&2 exit 1 fi