]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Clean up the crud supporting passed/failed count global variables as files.
authorGuy Harris <[email protected]>
Fri, 15 Sep 2017 01:21:45 +0000 (18:21 -0700)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 1 Jul 2018 14:25:08 +0000 (16:25 +0200)
Fetch the values from the files at the end of runComplexTests, rather
than at the beginning of runSimpleTests - they're already set to 0 if
you haven't run runComplexTests.

Set the variables to 0 right before writing their values to the files,
just to make it clearer that they're both being initialized to 0.

Read the files unconditionally in tests/crypto.sh, as we do tests
regardless of whether we were built with libcrypto or not.

(cherry picked from commit cd246d166df6ca6e9b460957fa27f12eb0a02f01)

tests/TESTrun.sh
tests/crypto.sh

index 6449082448d17988ccef57c597030ba27101f00c..21aa0d9f88f59452516ca205418b0c4eb7f8e105 100755 (executable)
@@ -2,8 +2,6 @@
 
 mkdir -p NEW
 mkdir -p DIFF
-passed=0
-failed=0
 cat /dev/null > failure-outputs.txt
 
 runComplexTests()
@@ -13,12 +11,12 @@ runComplexTests()
     case $i in TEST*.sh) continue;; esac
     sh ./$i
   done
+  passed=`cat .passed`
+  failed=`cat .failed`
 }
 
 runSimpleTests()
 {
-  passed=`cat .passed`
-  failed=`cat .failed`
   only=$1
   cat TESTLIST | while read name input output options
   do
@@ -43,6 +41,8 @@ runSimpleTests()
   failed=`cat .failed`
 }
 
+passed=0
+failed=0
 echo $passed >.passed
 echo $failed >.failed
 if [ $# -eq 0 ]
index 16a28555028dc0d3708381146300393be46e7545..b4277e4f7f645b717147eef11688b5dc85db22b8 100755 (executable)
@@ -1,13 +1,13 @@
 #!/bin/sh
 
 exitcode=0
+passed=`cat .passed`
+failed=`cat .failed`
 
 # Only attempt OpenSSL-specific tests when compiled with the library.
 
 if grep '^#define HAVE_LIBCRYPTO 1$' ../config.h >/dev/null
 then
-       passed=`cat .passed`
-       failed=`cat .failed`
        if ./TESTonce esp1 02-sunrise-sunset-esp.pcap esp1.out '-E "[email protected] 3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
        then
                passed=`expr $passed + 1`