From 287241d4497002c033a441b4f8c1d108d81b9f4f Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 5 Jul 2022 13:01:11 +1000 Subject: [PATCH] Only report not matching stderr content when we look for it The previous test code could emit "D:cds:stderr did not match ''" rather that just showing the contents of stderr. Moved the debug line inside the if/else block. Replaced backquotes with $() and $(()) as approriate. (cherry picked from commit 304d33fb32da4199e832daef027bd9228e4470a3) --- bin/tests/system/cds/tests.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/tests/system/cds/tests.sh b/bin/tests/system/cds/tests.sh index 84fb8a5fda..e70ec64eea 100644 --- a/bin/tests/system/cds/tests.sh +++ b/bin/tests/system/cds/tests.sh @@ -17,7 +17,7 @@ status=0 n=0 fail() { echo_i "failed" - status=`expr $status + 1` + status=$((status + 1)) } runcmd() { @@ -26,11 +26,11 @@ runcmd() { } testcase() { - n=`expr $n + 1` + n=$((n + 1)) echo_i "$name ($n)" expect=$1 shift - result=`runcmd "$@"` + result=$(runcmd "$@") check_stdout check_stderr if [ "$expect" -ne "$result" ]; then @@ -43,10 +43,10 @@ testcase() { check_stderr() { if [ -n "${err:=}" ]; then egrep "$err" err.$n >/dev/null && return 0 + echo_d "stderr did not match '$err'" else [ -s err.$n ] || return 0 fi - echo_d "stderr did not match '$err'" cat err.$n | cat_d fail }