From 255c15394c1c56ee056d23ccf999bee21a935f7f Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Thu, 29 Aug 2024 17:46:13 +0000 Subject: improve failure log of test_log_* --- regress/tests.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/regress/tests.sh b/regress/tests.sh index f4dc0eb..665d1ca 100644 --- a/regress/tests.sh +++ b/regress/tests.sh @@ -506,9 +506,9 @@ log style legacy' # remove the ip awk '{$1 = ""; print substr($0, 2)}' log > log.edited - printf '%s\n' 'GET gemini://localhost/ 20 text/gemini' \ - | cmp -s - log.edited - if [ $? -ne 0 ]; then + printf '%s\n' 'GET gemini://localhost/ 20 text/gemini' > log.exp + if ! cmp -s log.edited log.exp; then + diff -u log.edited log.exp # keep the log for post-mortem analysis return 1 fi @@ -530,8 +530,9 @@ log style common' awk '{$2 = ""; $5 = "timestamp"; print $0}' log > log.edited printf '%s\n' 'localhost - - timestamp +0200 "gemini://localhost/" 20 0' \ - | cmp -s - log.edited - if [ $? -ne 0 ]; then + > log.exp + if ! cmp -s log.edited log.exp; then + diff -u log.edited log.exp # keep the log for post-mortem analysis return 1 fi @@ -552,9 +553,9 @@ log style combined' # remove the ip and timestamp awk '{$1 = ""; print gensub("\\[.*\\]", "[timestamp]", 1)}' log > log.edited - printf '%s\n' ' - - [timestamp] "gemini://localhost/" 20 0 "-" ""' \ - | cmp -s - log.edited - if [ $? -ne 0 ]; then + printf '%s\n' ' - - [timestamp] "gemini://localhost/" 20 0 "-" ""' > log.exp + if ! cmp -s log.edited log.exp; then + diff -u log.edited log.exp # keep the log for post-mortem analysis return 1 fi -- cgit v1.2.3