]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Clean up "make check".
authorGuy Harris <[email protected]>
Mon, 19 Aug 2019 00:11:28 +0000 (17:11 -0700)
committerGuy Harris <[email protected]>
Mon, 19 Aug 2019 00:11:28 +0000 (17:11 -0700)
No need to make a "tests" directory under the build directory any more,
so don't do so.

As we're not cd'ing in the command line run from the Makefile (just in a
command run for command substitution), there's no need to put it in a
parenthesized subshell.

Again, as we're not cd'ing to the tests directory, if SRCDIR isn't set,
assume the source directory is the current directory.

In the shell scripts we're running, look for TESTonce, the input files,
the output files, and the -E input files from ${srcdir}/tests.  Make
sure we set srcdir in those shell scripts.

Makefile.in
tests/TESTrun.sh
tests/crypto.sh
tests/isis-seg-fault-1-v.sh
tests/lmp-v.sh

index 6f4c166f4818fd3552e4e45c7fec8bff39962643..adbaa03ee2eda2ade3e11b1d7ce26648b44af3ca 100644 (file)
@@ -443,7 +443,7 @@ distclean:
        rm -rf autom4te.cache tests/DIFF tests/NEW
 
 check: tcpdump
-       (mkdir -p tests && export SRCDIR=`cd ${srcdir}; pwd` && $${SRCDIR}/tests/TESTrun.sh )
+       export SRCDIR=`cd ${srcdir}; pwd` && $${SRCDIR}/tests/TESTrun.sh
 
 extags: $(TAGFILES)
        ctags $(TAGFILES)
index 0b5ee4b284c318433971494af01b0b2d484c9f4e..eb145666b52c97b97acccf011d1d1777382fa85b 100755 (executable)
@@ -1,12 +1,12 @@
 #!/bin/sh
 
 TZ=GMT0; export TZ
-srcdir=${SRCDIR-..}
+srcdir=${SRCDIR-.}
 
 echo RUNNING from ${srcdir}
 
 # make it absolute
-srcdir=$(cd $srcdir && pwd)
+srcdir=`cd $srcdir; pwd`
 
 # this should be run from the compiled build directory,
 # with srcdir= set to wherever the source code is.
index b4277e4f7f645b717147eef11688b5dc85db22b8..66d0be296e0f4e22c0b3430d4c2362313532a436 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+srcdir=${SRCDIR-.}
+
 exitcode=0
 passed=`cat .passed`
 failed=`cat .failed`
@@ -8,7 +10,7 @@ failed=`cat .failed`
 
 if grep '^#define HAVE_LIBCRYPTO 1$' ../config.h >/dev/null
 then
-       if ./TESTonce esp1 02-sunrise-sunset-esp.pcap esp1.out '-E "[email protected] 3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
+       if ${srcdir}/tests/TESTonce esp1 ${srcdir}/tests/02-sunrise-sunset-esp.pcap ${srcdir}/tests/esp1.out '-E "[email protected] 3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
        then
                passed=`expr $passed + 1`
                echo $passed >.passed
@@ -17,7 +19,7 @@ then
                echo $failed >.failed
                exitcode=1
        fi
-       if ./TESTonce esp2 08-sunrise-sunset-esp2.pcap esp2.out '-E "[email protected] 3des-cbc-hmac96:0x43434545464649494a4a4c4c4f4f51515252545457575840,[email protected] 3des-cbc-hmac96:0x434545464649494a4a4c4c4f4f5151525254545757584043"'
+       if ${srcdir}/tests/TESTonce esp2 ${srcdir}/tests/08-sunrise-sunset-esp2.pcap ${srcdir}/tests/esp2.out '-E "[email protected] 3des-cbc-hmac96:0x43434545464649494a4a4c4c4f4f51515252545457575840,[email protected] 3des-cbc-hmac96:0x434545464649494a4a4c4c4f4f5151525254545757584043"'
        then
                passed=`expr $passed + 1`
                echo $passed >.passed
@@ -26,7 +28,7 @@ then
                echo $failed >.failed
                exitcode=1
        fi
-       if ./TESTonce esp3 02-sunrise-sunset-esp.pcap esp1.out '-E "3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
+       if ${srcdir}/tests/TESTonce esp3 ${srcdir}/tests/02-sunrise-sunset-esp.pcap ${srcdir}/tests/esp1.out '-E "3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
        then
                passed=`expr $passed + 1`
                echo $passed >.passed
@@ -45,7 +47,7 @@ then
                printf "$FORMAT" ikev2pI2
                printf "$FORMAT" isakmp4
        else
-               if ./TESTonce esp4 08-sunrise-sunset-esp2.pcap esp2.out '-E "file esp-secrets.txt"'
+               if ${srcdir}/tests/TESTonce esp4 ${srcdir}/tests/08-sunrise-sunset-esp2.pcap ${srcdir}/tests/esp2.out "-E \"file ${srcdir}/tests/esp-secrets.txt\""
                then
                        passed=`expr $passed + 1`
                        echo $passed >.passed
@@ -54,7 +56,7 @@ then
                        echo $failed >.failed
                        exitcode=1
                fi
-               if ./TESTonce esp5 08-sunrise-sunset-aes.pcap esp5.out '-E "file esp-secrets.txt"'
+               if ${srcdir}/tests/TESTonce esp5 ${srcdir}/tests/08-sunrise-sunset-aes.pcap ${srcdir}/tests/esp5.out "-E \"file ${srcdir}/tests/esp-secrets.txt\""
                then
                        passed=`expr $passed + 1`
                        echo $passed >.passed
@@ -63,7 +65,7 @@ then
                        echo $failed >.failed
                        exitcode=1
                fi
-               if ./TESTonce espudp1 espudp1.pcap espudp1.out '-nnnn -E "file esp-secrets.txt"'
+               if ${srcdir}/tests/TESTonce espudp1 ${srcdir}/tests/espudp1.pcap ${srcdir}/tests/espudp1.out "-nnnn -E "\file ${srcdir}/tests/esp-secrets.txt\""
                then
                        passed=`expr $passed + 1`
                        echo $passed >.passed
@@ -72,7 +74,7 @@ then
                        echo $failed >.failed
                        exitcode=1
                fi
-               if ./TESTonce ikev2pI2 ikev2pI2.pcap ikev2pI2.out '-E "file ikev2pI2-secrets.txt" -v -v -v -v'
+               if ${srcdir}/tests/TESTonce ikev2pI2 ${srcdir}/tests/ikev2pI2.pcap ${srcdir}/tests/ikev2pI2.out "-E \"file ${srcdir}/tests/ikev2pI2-secrets.txt\" -v -v -v -v"
                then
                        passed=`expr $passed + 1`
                        echo $passed >.passed
@@ -81,7 +83,7 @@ then
                        echo $failed >.failed
                        exitcode=1
                fi
-               if ./TESTonce isakmp4 isakmp4500.pcap isakmp4.out '-E "file esp-secrets.txt"'
+               if ${srcdir}/tests/TESTonce isakmp4 ${srcdir}/tests/isakmp4500.pcap ${srcdir}/tests/isakmp4.out "-E \"${srcdir}/tests/file esp-secrets.txt\""
                then
                        passed=`expr $passed + 1`
                        echo $passed >.passed
@@ -91,7 +93,7 @@ then
                        exitcode=1
                fi
        fi
-       if ./TESTonce bgp-as-path-oobr-ssl bgp-as-path-oobr.pcap bgp-as-path-oobr-ssl.out '-vvv -e'
+       if ${srcdir}/tests/TESTonce bgp-as-path-oobr-ssl ${srcdir}/tests/bgp-as-path-oobr.pcap ${srcdir}/tests/bgp-as-path-oobr-ssl.out '-vvv -e'
        then
                passed=`expr $passed + 1`
                echo $passed >.passed
@@ -100,7 +102,7 @@ then
                echo $failed >.failed
                exitcode=1
        fi
-       if ./TESTonce bgp-aigp-oobr-ssl bgp-aigp-oobr.pcap bgp-aigp-oobr-ssl.out '-vvv -e'
+       if ${srcdir}/tests/TESTonce bgp-aigp-oobr-ssl ${srcdir}/tests/bgp-aigp-oobr.pcap ${srcdir}/tests/bgp-aigp-oobr-ssl.out '-vvv -e'
        then
                passed=`expr $passed + 1`
                echo $passed >.passed
@@ -124,7 +126,7 @@ else
        printf "$FORMAT" isakmp4
        printf "$FORMAT" bgp-as-path-oobr-ssl
        printf "$FORMAT" bgp-aigp-oobr-ssl
-       if ./TESTonce bgp-as-path-oobr-nossl bgp-as-path-oobr.pcap bgp-as-path-oobr-nossl.out '-vvv -e'
+       if ${srcdir}/tests/TESTonce bgp-as-path-oobr-nossl ${srcdir}/tests/bgp-as-path-oobr.pcap ${srcdir}/tests/bgp-as-path-oobr-nossl.out '-vvv -e'
        then
                passed=`expr $passed + 1`
                echo $passed >.passed
@@ -133,7 +135,7 @@ else
                echo $failed >.failed
                exitcode=1
        fi
-       if ./TESTonce bgp-aigp-oobr-nossl bgp-aigp-oobr.pcap bgp-aigp-oobr-nossl.out '-vvv -e'
+       if ${srcdir}/tests/TESTonce bgp-aigp-oobr-nossl ${srcdir}/tests/bgp-aigp-oobr.pcap ${srcdir}/tests/bgp-aigp-oobr-nossl.out '-vvv -e'
        then
                passed=`expr $passed + 1`
                echo $passed >.passed
index caae98dcd743cf3ee036d9457287099399f3ae7e..31200fa873dae24a79513f29e1649368af5fe3f5 100755 (executable)
@@ -4,6 +4,8 @@
 # may produce a slightly different result if the compiler is not GCC.
 # Test only with GCC (similar to GitHub issue #333).
 
+srcdir=${SRCDIR-.}
+
 exitcode=0
 test_name=isis-seg-fault-1-v
 
@@ -14,7 +16,7 @@ elif grep '^CC = .*gcc' ../Makefile >/dev/null
 then
        passed=`cat .passed`
        failed=`cat .failed`
-       if ./TESTonce $test_name isis-seg-fault-1.pcapng isis-seg-fault-1-v.out '-v'
+       if ${srcdir}/tests/TESTonce $test_name ${srcdir}/tests/isis-seg-fault-1.pcapng ${srcdir}/tests/isis-seg-fault-1-v.out '-v'
        then
                passed=`expr $passed + 1`
                echo $passed >.passed
index a8c6740e500f2d0cc6c0447f01a56fa77fa27de2..b8058811694c7a8c49522cf8b25eaa4344ddd506 100755 (executable)
@@ -6,6 +6,8 @@
 # GCC build and must reproduce correctly on any other GCC build regardless of
 # the architecture.
 
+srcdir=${SRCDIR-.}
+
 exitcode=0
 
 # A Windows build may have no file named Makefile and also a version of grep
@@ -17,7 +19,7 @@ elif grep '^CC = .*gcc' ../Makefile >/dev/null
 then
        passed=`cat .passed`
        failed=`cat .failed`
-       if ./TESTonce lmp-v lmp.pcap lmp-v.out '-T lmp -v'
+       if ${srcdir}/tests/TESTonce lmp-v ${srcdir}/tests/lmp.pcap ${srcdir}/tests/lmp-v.out '-T lmp -v'
        then
                passed=`expr $passed + 1`
                echo $passed >.passed