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.
This commit is contained in:
ridiculousfish
2021-09-16 19:24:45 -07:00
parent 0d8ffa8f87
commit 6db631ae88

View File

@@ -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