mirror of
https://github.com/versity/scoutfs.git
synced 2026-07-31 04:23:28 +00:00
Add t_rc test execution helper function
Add a quick wrapper to run commands whose output is saved while only echoing their return code. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user