]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - .travis-functions.sh
libblkid: check status for the current CDROM slot
[thirdparty/util-linux.git] / .travis-functions.sh
index f0a0d8990f474825fcccd5efafddc2a2fb7aa0ee..992905a1639eb4e0b2a272cb113c7c2368b2f4d5 100755 (executable)
@@ -5,6 +5,20 @@
 #   - helper functions to be sourced from .travis.yml
 #   - designed to respect travis' environment but testing locally is possible
 #
+# Variables:
+#
+#   TS_OPT_<name>_<something>=yes
+#          - forces tests/functions.sh:ts_has_option() to return "yes" for
+#            variable <something> in test <name>
+#
+#   TESTS_OPTIONS=
+#   TESTS_PARALLEL=
+#   TESTS_COMMAND=
+#          - overwrites default from tests/Makemodule.am
+#
+#   Do not use TS_* prefix for any travis or build-system stuff. This prefix is
+#   exclusively used by tests/ stuff.
+#
 
 if [ ! -f "configure.ac" ]; then
        echo ".travis-functions.sh must be sourced from source dir" >&2
@@ -15,7 +29,6 @@ fi
 # travis docs say we get 1.5 CPUs
 MAKE="make -j2"
 DUMP_CONFIG_LOG="short"
-export TS_OPT_parsable="yes"
 
 # workaround ugly warning on travis OSX,
 # see https://github.com/direnv/direnv/issues/210
@@ -49,17 +62,24 @@ function make_checkusage
 
 function check_nonroot
 {
-       local opts="$MAKE_CHECK_OPTS --show-diff"
-
-       xconfigure \
+       local make_opts="$MAKE_CHECK_OPTS --show-diff --parsable"
+       local conf_opts="\
                --disable-use-tty-group \
                --disable-makeinstall-chown \
-               --enable-all-programs \
-               || return
+               --enable-all-programs"
+
+       if [ "$TRAVIS_OS_NAME" != "osx" ]; then
+               conf_opts="$conf_opts --enable-asan"
+               make_opts="$make_opts --memcheck-asan"
+       fi
+
+       xconfigure $conf_opts || return
        $MAKE || return
 
        osx_prepare_check
-       $MAKE check TS_OPTS="$opts" || return
+
+       # TESTS_* overwrites default from tests/Makemodule.am
+       $MAKE check TESTS_OPTIONS="$make_opts" || return
 
        make_checkusage || return
 
@@ -68,16 +88,28 @@ function check_nonroot
 
 function check_root
 {
-       local opts="$MAKE_CHECK_OPTS --parallel=1 --show-diff"
+       local make_opts="$MAKE_CHECK_OPTS --show-diff"
+       local conf_opts="--enable-all-programs"
 
-       xconfigure \
-               --enable-all-programs \
-               || return
+       if [ "$TRAVIS_OS_NAME" != "osx" ]; then
+               conf_opts="$conf_opts --enable-asan"
+               make_opts="$make_opts --memcheck-asan"
+       fi
+
+       xconfigure $conf_opts || return
        $MAKE || return
 
-       $MAKE check TS_COMMAND="true" || return
+       # compile tests only
+       $MAKE check-programs || return
+
+       # Modify environment for OSX
        osx_prepare_check
-       sudo -E $MAKE check TS_OPTS="$opts" || return
+
+       # TESTS_* overwrites default from tests/Makemodule.am
+       sudo -E $MAKE check TESTS_PARALLEL="" TESTS_OPTIONS="$make_opts" || return
+
+       # root on osx has not enough permission for make install ;)
+       [ "$TRAVIS_OS_NAME" = "osx" ] && return
 
        # keep PATH to make sure sudo would find $CC
        sudo env "PATH=$PATH" $MAKE install || return
@@ -123,7 +155,6 @@ function travis_install_script
 function osx_install_script
 {
        brew update >/dev/null
-       brew tap homebrew/dupes
 
        brew install gettext ncurses socat xz
        brew link --force gettext