]> The Tcpdump Group git mirrors - tcpdump/blob - tests/lmp-v.sh
Use more the ND_TTEST_1() macro
[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 exitcode=0
10
11 # A Windows build may have no file named Makefile and also a version of grep
12 # that won't return an error when the file does not exist. Work around.
13 if [ ! -f ../Makefile ]
14 then
15 printf ' %-35s: TEST SKIPPED (no Makefile)\n' 'lmp-v'
16 elif grep '^CC = .*gcc' ../Makefile >/dev/null
17 then
18 passed=`cat .passed`
19 failed=`cat .failed`
20 if ./TESTonce lmp-v lmp.pcap lmp-v.out '-T lmp -v'
21 then
22 passed=`expr $passed + 1`
23 echo $passed >.passed
24 else
25 failed=`expr $failed + 1`
26 echo $failed >.failed
27 exitcode=1
28 fi
29 else
30 printf ' %-35s: TEST SKIPPED (compiler is not GCC)\n' 'lmp-v'
31 fi
32
33 exit $exitcode