]> The Tcpdump Group git mirrors - tcpdump/commitdiff
pull in TESTrun from mainline
authorMichael Richardson <[email protected]>
Thu, 12 Sep 2019 15:07:08 +0000 (11:07 -0400)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 24 Sep 2019 12:12:09 +0000 (14:12 +0200)
tests/TESTonce
tests/TESTrun.sh

index d60c01ff8dda90868728603ef11b57d22885face..d499c07f8b68d253b5e8122f01fe588f09047688 100755 (executable)
@@ -1,6 +1,9 @@
 #!/usr/bin/env perl
 
+$TCPDUMP = "../tcpdump" if (!($TCPDUMP = $ENV{TCPDUMP_BIN}));
+
 use File::Basename;
+use POSIX qw( WEXITSTATUS WIFEXITED);
 
 system("mkdir -p NEW DIFF");
 
@@ -26,7 +29,7 @@ my $diffstat = 0;
 my $errdiffstat = 0;
 
 if ($^O eq 'MSWin32') {
-    $r = system "..\\windump -n -t -r $input $options 2>NUL | sed 's/\\r//' | tee NEW/$outputbase | diff $output - >DIFF/$outputbase.diff";
+    $r = system "..\\windump -# -n -r $input $options 2>NUL | sed 's/\\r//' | tee NEW/$outputbase | diff $output - >DIFF/$outputbase.diff";
     # need to do same as below for Cygwin.
 }
 else {
@@ -107,7 +110,6 @@ if($r == 0) {
     unlink "DIFF/$outputbase.diff";
     exit 0;
 }
-
 # must have failed!
 printf "    %-35s: TEST FAILED(exit core=%d/diffstat=%d,%d/r=%d)", $name, $coredump, $diffstat, $errdiffstat, $r;
 open FOUT, '>>failure-outputs.txt';
index 3301830bc350c8a54395e8856f3db29db9868fa7..02e89082bad0bcb57c180d4532f0836230dca5a4 100755 (executable)
@@ -1,13 +1,10 @@
 #!/bin/sh
 
+TZ=GMT0; export TZ
 srcdir=${SRCDIR-..}
 
 echo RUNNING from ${srcdir}
 
-<<<<<<< HEAD
-mkdir -p NEW
-mkdir -p DIFF
-
 # make it absolute
 srcdir=$(cd $srcdir && pwd)
 
@@ -21,15 +18,18 @@ failedfile=$(pwd)/tests/.failed
 failureoutput=$(pwd)/tests/failure-outputs.txt
 mkdir -p tests/NEW
 mkdir -p tests/DIFF
-
 cat /dev/null > ${failureoutput}
 
 runComplexTests()
 {
   for i in ${srcdir}/tests/*.sh
   do
-    case $i in ${srcdir}/tests/TEST*.sh) continue;; esac
-    sh $i ${srcdir}
+    case $i in
+        ${srcdir}/tests/TEST*.sh) continue;;
+        ${srcdir}/tests/\*.sh) continue;;
+    esac
+    echo Running $i
+    (cd tests && sh $i ${srcdir})
   done
   passed=`cat ${passedfile}`
   failed=`cat ${failedfile}`
@@ -51,7 +51,6 @@ runSimpleTests()
     passed=`cat ${passedfile}`
     failed=`cat ${failedfile}`
     (cd tests  # run TESTonce in tests directory
-
     if ${srcdir}/tests/TESTonce $name ${srcdir}/tests/$input ${srcdir}/tests/$output "$options"
     then
       passed=`expr $passed + 1`
@@ -63,7 +62,6 @@ runSimpleTests()
     if [ -d COREFILES ]; then
         if [ -f core ]; then mv core COREFILES/$name.core; fi
     fi)
-
     [ "$only" != "" -a "$name" = "$only" ] && break
   done
   # I hate shells with their stupid, useless subshells.