]> The Tcpdump Group git mirrors - tcpdump/blob - tests/lmp-v.sh
PIM: Fix some length checks
[tcpdump] / tests / lmp-v.sh
1 #!/bin/sh
2
3 # The "verbose" Link Management Protocol test involves a float calculation that
4 # may produce a slightly different result depending on the architecture and the
5 # compiler (see GitHub issue #333). The reference output was produced using a
6 # GCC build and must reproduce correctly on any other GCC build regardless of
7 # the architecture.
8
9 #
10 # Get the tests directory from $0.
11 #
12 testsdir=`dirname "$0"`
13
14 exitcode=0
15
16 # A Windows build may have no file named Makefile and also a version of grep
17 # that won't return an error when the file does not exist. Work around.
18 if [ ! -f ../Makefile ]
19 then
20 printf ' %-35s: TEST SKIPPED (no Makefile)\n' 'lmp-v'
21 elif grep '^CC = .*gcc' ../Makefile >/dev/null
22 then
23 passed=`cat .passed`
24 failed=`cat .failed`
25 if ${testsdir}/TESTonce lmp-v ${testsdir}/lmp.pcap ${testsdir}/lmp-v.out '-T lmp -v'
26 then
27 passed=`expr $passed + 1`
28 echo $passed >.passed
29 else
30 failed=`expr $failed + 1`
31 echo $failed >.failed
32 exitcode=1
33 fi
34 else
35 printf ' %-35s: TEST SKIPPED (compiler is not GCC)\n' 'lmp-v'
36 fi
37
38 exit $exitcode