tests: adds easy localization

This commit is contained in:
Emma Tebibyte 2024-05-27 22:17:30 -06:00
parent 9bfc587623
commit 94ada03ce4
Signed by untrusted user: emma
GPG Key ID: 06FA419A1698C270
2 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,4 @@
#!/bin/sh
export RUN_ERR='Run this script in the root of the project'
export TEST_STR='Testing utility'

View File

@ -9,11 +9,13 @@
set -e
. "./locales/$LANG"
export BIN=build/bin
if ! ls Makefile >/dev/null 2>&1
then
printf '%s: Run this script in the root of the project.\n' "$0" 1>&2
printf '%s: %s.\n' "$0" "$RUN_ERR" 1>&2
exit 1
fi
@ -21,7 +23,7 @@ for script in tests/bonsai/*.sh; do
export UTIL="$(printf '%s\n' "$script" \
| sed -e 's/\.sh//g' -e 's;tests\/bonsai\/;;g')"
printf '%s: %s: Testing utility.\n' "$0" "$UTIL"
printf '%s: %s: %s\n' "$0" "$UTIL" "$TEST_STR"
"$script"
printf '\n'
done