-# Allow overriding the source and build directories
-if [ "x${BT_TESTS_SRCDIR:-}" = "x" ]; then
- BT_TESTS_SRCDIR="$scriptdir/.."
+# 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
+ MINGW*)
+ BT_TESTS_OS_TYPE="mingw"
+ ;;
+ Darwin)
+ BT_TESTS_OS_TYPE="darwin"
+ ;;
+ Linux)
+ BT_TESTS_OS_TYPE="linux"
+ ;;
+ CYGWIN*)
+ BT_TESTS_OS_TYPE="cygwin"
+ ;;
+ *)
+ BT_TESTS_OS_TYPE="unsupported"
+ ;;
+ esac
+fi
+export BT_TESTS_OS_TYPE
+
+# Base source directory of tests
+if [ -z "${BT_TESTS_SRCDIR:-}" ]; then
+ BT_TESTS_SRCDIR="$testsdir"