diff --git a/tests/funcs/exec.sh b/tests/funcs/exec.sh index 379f1ea5..06d4c96b 100644 --- a/tests/funcs/exec.sh +++ b/tests/funcs/exec.sh @@ -39,6 +39,18 @@ t_quiet() t_fail "quiet command failed" } +# +# Quietly run a command during a test. The output is logged but only +# the return code is printed, presumably because the output contains +# a lot of invocation specific text that is difficult to filter. +# +t_rc() +{ + echo "# $*" >> "$T_TMP.rc.log" + "$@" >> "$T_TMP.rc.log" 2>&1 + echo "rc: $?" +} + # # redirect test output back to the output of the invoking script intead # of the compared output.