]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - .travis-functions.sh
Merge branch 'dmverity_options' of https://github.com/bluca/util-linux
[thirdparty/util-linux.git] / .travis-functions.sh
index ba7ba1eaf85edbae40ab6cb0682ad1c1fb8751ad..617740212afe66345f3d4d578d1ef08db8a6395c 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,7 +62,7 @@ function make_checkusage
 
 function check_nonroot
 {
-       local make_opts="$MAKE_CHECK_OPTS --show-diff"
+       local make_opts="$MAKE_CHECK_OPTS --show-diff --parsable"
        local conf_opts="\
                --disable-use-tty-group \
                --disable-makeinstall-chown \
@@ -64,7 +77,9 @@ function check_nonroot
        $MAKE || return
 
        osx_prepare_check
-       $MAKE check TS_OPTS="$make_opts" || return
+
+       # TESTS_* overwrites default from tests/Makemodule.am
+       $MAKE check TESTS_OPTIONS="$make_opts" || return
 
        make_checkusage || return
 
@@ -84,9 +99,14 @@ function check_root
        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="$make_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