lmp-v.sh 967 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. # The "verbose" Link Management Protocol test involves a float calculation that
  3. # may produce a slightly different result depending on the architecture and the
  4. # compiler (see GitHub issue #333). The reference output was produced using a
  5. # GCC build and must reproduce correctly on any other GCC build regardless of
  6. # the architecture.
  7. exitcode=0
  8. # A Windows build may have no file named Makefile and also a version of grep
  9. # that won't return an error when the file does not exist. Work around.
  10. if [ ! -f ../Makefile ]
  11. then
  12. printf ' %-35s: TEST SKIPPED (no Makefile)\n' 'lmp-v'
  13. elif grep '^CC = .*gcc' ../Makefile >/dev/null
  14. then
  15. passed=`cat .passed`
  16. failed=`cat .failed`
  17. if ./TESTonce lmp-v lmp.pcap lmp-v.out '-T lmp -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' 'lmp-v'
  28. fi
  29. exit $exitcode