-# If "readlink -f" is available, get a resolved absolute path to the
-# tests source dir, otherwise make do with a relative path.
-scriptdir="$(dirname "${BASH_SOURCE[0]}")"
-if readlink -f "." >/dev/null 2>&1; then
- testsdir=$(readlink -f "$scriptdir/..")
-else
- testsdir="$scriptdir/.."
-fi
-
-# The OS on which we are running. See [1] for possible values of 'uname -s'.
-# We do a bit of translation to ease our life down the road for comparison.
-# Export it so that called executables can use it.
-# [1] https://en.wikipedia.org/wiki/Uname#Examples
-if [ -z "${BT_TESTS_OS_TYPE:-}" ]; then
- BT_TESTS_OS_TYPE="$(uname -s)"
- case "$BT_TESTS_OS_TYPE" in
+# Name of the OS on which we're running, if not set.
+#
+# One of:
+#
+# `mingw`: MinGW (Windows)
+# `darwin`: macOS
+# `linux`: Linux
+# `cygwin`: Cygwin (Windows)
+# `unsupported`: Anything else
+#
+# See <https://en.wikipedia.org/wiki/Uname#Examples> for possible values
+# of `uname -s`.
+#
+# Do some translation to ease our life down the road for comparison.
+# Export it so that executed commands can use it.
+if [[ -z ${BT_TESTS_OS_TYPE:-} ]]; then
+ BT_TESTS_OS_TYPE=$(uname -s)
+ case $BT_TESTS_OS_TYPE in