]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Show stderr output from tcpdump other than "reading from file...".
authorGuy Harris <[email protected]>
Mon, 19 Aug 2019 17:11:50 +0000 (10:11 -0700)
committerGuy Harris <[email protected]>
Mon, 19 Aug 2019 17:12:06 +0000 (10:12 -0700)
tests/TESTonce

index d499c07f8b68d253b5e8122f01fe588f09047688..693905768916782b30ec1d2c491372f0c25d46f5 100755 (executable)
@@ -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;