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: 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 set -e
. "./locales/$LANG"
export BIN=build/bin export BIN=build/bin
if ! ls Makefile >/dev/null 2>&1 if ! ls Makefile >/dev/null 2>&1
then 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 exit 1
fi fi
@ -21,7 +23,7 @@ for script in tests/bonsai/*.sh; do
export UTIL="$(printf '%s\n' "$script" \ export UTIL="$(printf '%s\n' "$script" \
| sed -e 's/\.sh//g' -e 's;tests\/bonsai\/;;g')" | 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" "$script"
printf '\n' printf '\n'
done done