X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=tests%2Futils%2Futils.sh;h=212807bba3f302cd6f0c7b7c7ff16b61538f7a61;hb=ef9cd5c799d6a7dade15a0e1c5e18831d0ac534b;hp=cefb782c1d2aef4207dcbda646d45375708dbfa1;hpb=dbbb73968ec9af48c2b0b9ea65a4b03843109f7d;p=lttng-ust.git diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index cefb782c..212807bb 100755 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -31,3 +31,33 @@ if [ "x${UST_TESTS_BUILDDIR:-}" = "x" ]; then UST_TESTS_BUILDDIR="$testsdir" fi export UST_TESTS_BUILDDIR + +# 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 [ "x${UST_OS_TYPE:-}" = "x" ]; then + UST_OS_TYPE="$(uname -s)" + case "$UST_OS_TYPE" in + MINGW*) + UST_OS_TYPE="mingw" + ;; + Darwin) + UST_OS_TYPE="darwin" + ;; + Linux) + UST_OS_TYPE="linux" + ;; + CYGWIN*) + UST_OS_TYPE="cygwin" + ;; + FreeBSD) + UST_OS_TYPE="freebsd" + ;; + *) + UST_OS_TYPE="unsupported" + ;; + esac +fi +export UST_OS_TYPE +