From: Karel Zak Date: Wed, 9 Oct 2019 10:57:10 +0000 (+0200) Subject: tests: add --parsable, remove TS_OPT_parsable X-Git-Tag: v2.35-rc1~110 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=406fb25387870d434f61f6970c165fc576b68a98;p=thirdparty%2Futil-linux.git tests: add --parsable, remove TS_OPT_parsable * 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 --- diff --git a/.travis-functions.sh b/.travis-functions.sh index 71bc9bf788..617740212a 100755 --- a/.travis-functions.sh +++ b/.travis-functions.sh @@ -12,7 +12,7 @@ # variable in test # # 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 diff --git a/tests/Makemodule.am b/tests/Makemodule.am index e8df39e0f0..31cf70f42d 100644 --- a/tests/Makemodule.am +++ b/tests/Makemodule.am @@ -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) diff --git a/tests/run.sh b/tests/run.sh index 1c3efdb6e9..29588fa03d 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -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= autotools top source directory" echo " --builddir= autotools top build directory" - echo " --parallel= number of parallel test jobs, default: num cpus" + echo " --parallel= number of parallel test jobs, default: num cpus" + echo " --parsable use parsable output (default on --parallel)" echo " --exclude= exclude tests by list '/ ..'" echo exit 1