]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add --parsable, remove TS_OPT_parsable
authorKarel Zak <kzak@redhat.com>
Wed, 9 Oct 2019 10:57:10 +0000 (12:57 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 9 Oct 2019 11:04:34 +0000 (13:04 +0200)
* don't enable parsable for non-parallel executions in travis
* add --parsable to run.sh
* use --parsable rather than TS_OPT_ in travis

Signed-off-by: Karel Zak <kzak@redhat.com>
.travis-functions.sh
tests/Makemodule.am
tests/run.sh

index 71bc9bf788ac291e34d8a09a17bfc95d247c4940..617740212afe66345f3d4d578d1ef08db8a6395c 100755 (executable)
@@ -12,7 +12,7 @@
 #            variable <something> in test <name>
 #
 #   TESTS_OPTIONS=
-#   TESTS_PARALLEL_OPTION=
+#   TESTS_PARALLEL=
 #   TESTS_COMMAND=
 #          - overwrites default from tests/Makemodule.am
 #
@@ -29,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
@@ -63,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 \
@@ -107,7 +106,7 @@ function check_root
        osx_prepare_check
 
        # TESTS_* overwrites default from tests/Makemodule.am
-       sudo -E $MAKE check "TESTS_PARALLEL_OPTION=--parallel=none" TESTS_OPTIONS="$make_opts" || return
+       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
index e8df39e0f0f893f0eb6ec8e4c0c6e787c8b9a890..31cf70f42d27513b54863c8ff79933424aadcead 100644 (file)
@@ -14,11 +14,11 @@ clean-local-tests:
 CLEAN_LOCALS += clean-local-tests
 
 TESTS_OPTIONS = --nonroot
-TESTS_PARALLEL_OPTION = --parallel
+TESTS_PARALLEL = --parallel
 TESTS_COMMAND = $(top_srcdir)/tests/run.sh \
        --srcdir=$(abs_top_srcdir) \
        --builddir=$(abs_top_builddir) \
-       $(TESTS_PARALLEL_OPTION) \
+       $(TESTS_PARALLEL) \
        $(TESTS_OPTIONS)
 
 check-local-tests: $(check_PROGRAMS)
index 1c3efdb6e9a808c81a9c914efae82f4da4c83481..29588fa03d5c239f5ae4772265416b65e2553c80 100755 (executable)
@@ -93,9 +93,7 @@ while [ -n "$1" ]; do
                ;;
        --parallel=*)
                paraller_jobs="${1##--parallel=}"
-               if [ "$paraller_jobs" = "none" ]; then
-                       paraller_jobs=1
-               elif ! [ "$paraller_jobs" -ge 0 ] 2>/dev/null; then
+               if ! [ "$paraller_jobs" -ge 0 ] 2>/dev/null; then
                        echo "invalid argument '$paraller_jobs' for --parallel="
                        exit 1
                fi
@@ -103,6 +101,9 @@ while [ -n "$1" ]; do
        --parallel)
                paraller_jobs=$(num_cpus)
                ;;
+       --parsable)
+               OPTS="$OPTS $1"
+               ;;
        --exclude=*)
                EXCLUDETESTS="${1##--exclude=}"
                ;;
@@ -123,7 +124,8 @@ while [ -n "$1" ]; do
                echo "  --noskip-commands     fail on missing commands"
                echo "  --srcdir=<path>       autotools top source directory"
                echo "  --builddir=<path>     autotools top build directory"
-               echo "  --parallel=<num|none> number of parallel test jobs, default: num cpus"
+               echo "  --parallel=<num>      number of parallel test jobs, default: num cpus"
+               echo "  --parsable            use parsable output (default on --parallel)"
                echo "  --exclude=<list>      exclude tests by list '<utilname>/<testname> ..'"
                echo
                exit 1