tests: add --noskip-commands

The default is SKIP missing commands on --use-system-commands, but
with --noskip-commands the test will FAIL.

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2019-03-05 11:06:41 +01:00
parent bb872a239c
commit 7c90efa384
2 changed files with 10 additions and 1 deletions

View File

@ -85,7 +85,13 @@ function ts_check_test_command {
*)
# just command names (e.g. --use-system-commands)
local cmd=$1
type "$cmd" >/dev/null 2>&1 || ts_skip "missing in PATH: $cmd"
type "$cmd" >/dev/null 2>&1
if [ $? -ne 0 ]; then
if [ "$TS_NOSKIP_COMMANDS" = "yes" ]; then
ts_failed "missing in PATH: $cmd"
fi
ts_skip "missing in PATH: $cmd"
fi
;;
esac
}
@ -301,6 +307,7 @@ function ts_init_env {
ts_init_core_env
TS_NOSKIP_COMMANDS=$(ts_has_option "noskip-commands" "$*")
TS_VERBOSE=$(ts_has_option "verbose" "$*")
TS_SHOWDIFF=$(ts_has_option "show-diff" "$*")
TS_PARALLEL=$(ts_has_option "parallel" "$*")

View File

@ -65,6 +65,7 @@ while [ -n "$1" ]; do
--show-diff |\
--verbose |\
--skip-loopdevs |\
--noskip-commands |\
--parsable)
# these options are simply forwarded to the test scripts
OPTS="$OPTS $1"
@ -113,6 +114,7 @@ while [ -n "$1" ]; do
echo " --show-diff show diff from failed tests"
echo " --nonroot ignore test suite if user is root"
echo " --use-system-commands use PATH rather than builddir"
echo " --noskip-commands fail on missing commands"
echo " --srcdir=<path> autotools top source directory"
echo " --builddir=<path> autotools top build directory"
echo " --parallel=<num> number of parallel test jobs, default: num cpus"