From 6db631ae8828081476d046a1bac8772a48aef101 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 16 Sep 2021 19:24:45 -0700 Subject: [PATCH] Fix test driver on BSDs FreeBSD at least has `realpath` without `--no-symlinks`, so the tests cannot start. Fix this by using the `pwd -P` trick. --- tests/test_driver.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/test_driver.sh b/tests/test_driver.sh index 9061d5e44..01c01dfdf 100644 --- a/tests/test_driver.sh +++ b/tests/test_driver.sh @@ -29,14 +29,8 @@ die() { # To keep things sane and to make error messages comprehensible, do not use relative paths anywhere # in this script. Instead, make all paths relative to one of these or the new $HOME ($homedir)." -TESTS_ROOT="$(dirname "$0")" -BUILD_ROOT="${TESTS_ROOT}/.." - -# macOS (still!) doesn't have `readlink -f` or `realpath`. That's OK, this is just for aesthetics. -if command -v realpath 1>/dev/null 2>/dev/null; then - TESTS_ROOT="$(realpath --no-symlinks "${TESTS_ROOT}")" - BUILD_ROOT="$(realpath --no-symlinks "${BUILD_ROOT}")" -fi +TESTS_ROOT="$(cd $(dirname "$0") && pwd -P)" +BUILD_ROOT="$(cd $(dirname "$TESTS_ROOT") && pwd -P)" if ! test -z "$__fish_is_running_tests"; then echo "Recursive test invocation detected!" 1>&2