Imported Upstream version 4.9.2
[platform/upstream/tcpdump.git] / tests / isis-seg-fault-1-v.sh
1 #!/bin/sh
2
3 # This "verbose" ISIS protocol test involves a float calculation that
4 # may produce a slightly different result if the compiler is not GCC.
5 # Test only with GCC (similar to GitHub issue #333).
6
7 exitcode=0
8 test_name=isis-seg-fault-1-v
9
10 if [ ! -f ../Makefile ]
11 then
12         printf '    %-35s: TEST SKIPPED (no Makefile)\n' $test_name
13 elif grep '^CC = .*gcc' ../Makefile >/dev/null
14 then
15         passed=`cat .passed`
16         failed=`cat .failed`
17         if ./TESTonce $test_name isis-seg-fault-1.pcap isis-seg-fault-1-v.out '-v'
18         then
19                 passed=`expr $passed + 1`
20                 echo $passed >.passed
21         else
22                 failed=`expr $failed + 1`
23                 echo $failed >.failed
24                 exitcode=1
25         fi
26 else
27         printf '    %-35s: TEST SKIPPED (compiler is not GCC)\n' $test_name
28 fi
29
30 exit $exitcode