From 94ada03ce4a6624e3430091a805e131f0f35941b Mon Sep 17 00:00:00 2001 From: emma Date: Mon, 27 May 2024 22:17:30 -0600 Subject: [PATCH] tests: adds easy localization --- tests/locales/en_US.UTF-8 | 4 ++++ tests/test.sh | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 tests/locales/en_US.UTF-8 diff --git a/tests/locales/en_US.UTF-8 b/tests/locales/en_US.UTF-8 new file mode 100644 index 0000000..95e2efb --- /dev/null +++ b/tests/locales/en_US.UTF-8 @@ -0,0 +1,4 @@ +#!/bin/sh + +export RUN_ERR='Run this script in the root of the project' +export TEST_STR='Testing utility' diff --git a/tests/test.sh b/tests/test.sh index 43f6eb8..47a57a3 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -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