]> The Tcpdump Group git mirrors - tcpdump/blobdiff - tests/lmp-v.sh
Default to first interface from pcap_findalldevs()
[tcpdump] / tests / lmp-v.sh
index 0c14291a18170180a6e559dc4c44ab52ad8d1bd2..138a0cd292adac6159d4860627b2eac7cf4bea7c 100755 (executable)
@@ -6,9 +6,14 @@
 # GCC build and must reproduce correctly on any other GCC build regardless of
 # the architecture.
 
-if grep -qe '^CC = gcc$' ../Makefile
+# A Windows build may have no file named Makefile and also a version of grep
+# that won't return an error when the file does not exist. Work around.
+if [ ! -f ../Makefile ]
+then
+       printf '    %-30s: TEST SKIPPED (no Makefile)\n' 'lmp-v'
+elif grep '^CC = .*gcc' ../Makefile >/dev/null
 then
   ./TESTonce lmp-v lmp.pcap lmp-v.out '-t -T lmp -v'
 else
-       printf '%-30s: TEST SKIPPED (compiler is not GCC)\n' 'lmp-v'
+       printf '    %-30s: TEST SKIPPED (compiler is not GCC)\n' 'lmp-v'
 fi