[Pdbg] [PATCH v2 5/5] tests: Log stderr output (if any) on test failure
Amitay Isaacs
amitay at ozlabs.org
Wed Nov 14 16:14:11 AEDT 2018
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
tests/driver.sh | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tests/driver.sh b/tests/driver.sh
index 16d6b71..bbb57b1 100644
--- a/tests/driver.sh
+++ b/tests/driver.sh
@@ -370,9 +370,9 @@ test_run ()
output_mismatch=1
fi
+ output_stderr_raw=$(cat "$stderr_file")
+ output_stderr=$(cat "$stderr_file" | result_filter)
if [ $test_stderr -eq 1 ] ; then
- output_stderr_raw=$(cat "$stderr_file")
- output_stderr=$(cat "$stderr_file" | result_filter)
if [ "$output_stderr" != "$required_output_stderr" ] ; then
test_log "expected stderr:"
test_log "$required_output_stderr"
@@ -384,6 +384,13 @@ test_run ()
fi
output_mismatch=1
fi
+ else
+ if [ $rc -ne $required_rc -o $output_mismatch -eq 1 ] ; then
+ if [ -n "$output_stderr_raw" ] ; then
+ test_log "output stderr:"
+ test_log "$output_stderr_raw"
+ fi
+ fi
fi
rm -f "$stderr_file"
--
2.19.1
More information about the Pdbg
mailing list