From: Guy Harris Date: Mon, 19 Aug 2019 17:11:50 +0000 (-0700) Subject: Show stderr output from tcpdump other than "reading from file...". X-Git-Tag: tcpdump-4.99-bp~675 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/12fdf9aab04523d0b0a68e4783e47444d15b1bda Show stderr output from tcpdump other than "reading from file...". --- diff --git a/tests/TESTonce b/tests/TESTonce index d499c07f..69390576 100755 --- a/tests/TESTonce +++ b/tests/TESTonce @@ -102,11 +102,12 @@ else { } if($r == 0) { - my $stderrlog=""; - if($linecount > 0) { - $stderrlog=sprintf("-- %d lines extra in stderr", $linecount); + if($linecount == 0) { + printf " %-35s: passed\n", $name; + } else { + printf " %-35s: passed with error messages:\n", $name; + system "cat $stderrlog"; } - printf " %-35s: passed%s\n", $name, $stderrlog; unlink "DIFF/$outputbase.diff"; exit 0; } @@ -134,8 +135,19 @@ if($r & 127 || -f "core") { if(-f "core") { $with = "with"; } - printf " (terminated with signal %u, %s coredump)\n", ($r & 127), $with; + printf " (terminated with signal %u, %s coredump)", ($r & 127), $with; + if($linecount == 0) { + print "\n"; + } else { + print " with error messages:\n"; + system "cat $stderrlog"; + } exit ($r & 128) ? 10 : 20; } -print "\n"; +if($linecount == 0) { + print "\n"; +} else { + print " with error messages:\n"; + system "cat $stderrlog"; +} exit $r >> 8;