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