From 7c90efa384cbb2ace873e2b90e8cc396a1719535 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 5 Mar 2019 11:06:41 +0100 Subject: 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 --- tests/functions.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/functions.sh') diff --git a/tests/functions.sh b/tests/functions.sh index ab607c4ce..0605a1320 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -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" "$*") -- cgit v1.2.3-55-g7522