From 060c4cee0f907cd90b5c0f45190b0b9576b1623e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 9 Oct 2019 12:31:28 +0200 Subject: [PATCH] build-sys: cleanup prefixed used for tests It's ugly to use the same TS_ prefix in tests as well as in build-system (e.g. make check), because then some env. variable can be interpreted by our regression tests. For example TS_PARALLEL=. It's seems better to use TS_ exclusively for tests and TESTS_ for build-system. Signed-off-by: Karel Zak --- .travis-functions.sh | 22 ++++++++++++++++++---- tests/Makemodule.am | 14 ++++++++------ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.travis-functions.sh b/.travis-functions.sh index 4cd145668c..71bc9bf788 100755 --- a/.travis-functions.sh +++ b/.travis-functions.sh @@ -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__=yes +# - forces tests/functions.sh:ts_has_option() to return "yes" for +# variable in test +# +# TESTS_OPTIONS= +# TESTS_PARALLEL_OPTION= +# 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 @@ -65,8 +79,8 @@ function check_nonroot osx_prepare_check - # TS_OPTS= overwrites default from tests/Makemodule.am - $MAKE check TS_OPTS="$make_opts" || return + # TESTS_* overwrites default from tests/Makemodule.am + $MAKE check TESTS_OPTIONS="$make_opts" || return make_checkusage || return @@ -92,8 +106,8 @@ function check_root # Modify environment for OSX osx_prepare_check - # TS_OPTS= overwrites default from tests/Makemodule.am - sudo -E $MAKE check "TS_PARALLEL=--parallel=none" TS_OPTS="$make_opts" || return + # TESTS_* overwrites default from tests/Makemodule.am + sudo -E $MAKE check "TESTS_PARALLEL_OPTION=--parallel=none" 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 9be544f4a3..e8df39e0f0 100644 --- a/tests/Makemodule.am +++ b/tests/Makemodule.am @@ -13,13 +13,15 @@ clean-local-tests: CLEAN_LOCALS += clean-local-tests -TS_OPTS = --nonroot -TS_PARALLEL = --parallel -TS_COMMAND = $(top_srcdir)/tests/run.sh \ - --srcdir=$(abs_top_srcdir) --builddir=$(abs_top_builddir) \ - $(TS_PARALLEL) $(TS_OPTS) +TESTS_OPTIONS = --nonroot +TESTS_PARALLEL_OPTION = --parallel +TESTS_COMMAND = $(top_srcdir)/tests/run.sh \ + --srcdir=$(abs_top_srcdir) \ + --builddir=$(abs_top_builddir) \ + $(TESTS_PARALLEL_OPTION) \ + $(TESTS_OPTIONS) check-local-tests: $(check_PROGRAMS) - $(AM_V_GEN) $(TS_COMMAND) + $(AM_V_GEN) $(TESTS_COMMAND) CHECK_LOCALS += check-local-tests -- 2.47.2