From c3de539d46a391da7d4e1f4393ddadf2c5235ac3 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Wed, 1 Jan 2025 14:17:41 +0100 Subject: [PATCH] test_driver: Error out if $FISHDIR isn't given This avoids confusion when you forget to set it and run it on the wrong fish. --- tests/test_driver.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_driver.sh b/tests/test_driver.sh index fbf3fe73a..86a84a002 100755 --- a/tests/test_driver.sh +++ b/tests/test_driver.sh @@ -34,8 +34,12 @@ die() { TESTS_ROOT="$(cd $(dirname "$0") && pwd -P)" BUILD_ROOT="$(cd $(dirname "$TESTS_ROOT") && pwd -P)" -test -n "$FISHDIR" && FISHDIR=$(realpath -- "$FISHDIR") -fish="${FISHDIR:-${BUILD_ROOT}/test/root/bin}/fish" +if test -z "$FISHDIR"; then + die "Please set \$FISHDIR to a directory that contains fish, fish_indent and fish_key_reader" +fi + +FISHDIR=$(realpath -- "$FISHDIR") +fish="${FISHDIR}/fish" if ! test -x "$fish" || ! test -f "$fish"; then printf '%s\n' "'$fish' is not an executable fish." \