diff options
author | Kate Ward <kate.ward@forestent.com> | 2020-04-11 20:21:26 +0200 |
---|---|---|
committer | Kate Ward <kate.ward@forestent.com> | 2020-04-11 20:21:26 +0200 |
commit | 34692b35773293bda4349ea5e5130dbb7249fd2b (patch) | |
tree | 33d06c79c513cea23a46223c101428e6e7b789aa | |
parent | 417b8e76d29a207da015b164b9cdd4f319b7ab6c (diff) | |
download | shflags-34692b35773293bda4349ea5e5130dbb7249fd2b.tar.gz |
Fixes to th_showOutput().
-rw-r--r-- | shflags_test_helpers | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/shflags_test_helpers b/shflags_test_helpers index d808d0f..9b8e41e 100644 --- a/shflags_test_helpers +++ b/shflags_test_helpers @@ -70,22 +70,26 @@ th_oneTimeSetUp() { } th_showOutput() { - _th_rtrn="${1:-${returnF}}" + if isSkipping; then + return + fi + + _th_return="${1:-${returnF}}" _th_stdout="${2:-${stdoutF}}" _th_stderr="${3:-${stderrF}}" - isSkipping - if [ $? -eq "${SHUNIT_FALSE}" -a "${_th_rtrn}" != "${FLAGS_TRUE}" ]; then + if [ "${_th_return}" != "${FLAGS_TRUE}" ]; then + # shellcheck disable=SC2166 if [ -n "${_th_stdout}" -a -s "${_th_stdout}" ]; then echo '>>> STDOUT' >&2 cat "${_th_stdout}" >&2 + echo '<<< STDOUT' >&2 fi + # shellcheck disable=SC2166 if [ -n "${_th_stderr}" -a -s "${_th_stderr}" ]; then echo '>>> STDERR' >&2 cat "${_th_stderr}" >&2 - fi - if [ -n "${_th_stdout}" -o -n "${_th_stderr}" ]; then - echo '<<< end output' >&2 + echo '<<< STDERR' >&2 fi fi |