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 <kzak@redhat.com>
This commit is contained in:
Karel Zak 2019-10-09 12:57:10 +02:00
parent 060c4cee0f
commit 406fb25387
3 changed files with 11 additions and 10 deletions

View File

@ -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

View 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)

View File

@ -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