check.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #! /bin/sh
  2. set -e
  3. #
  4. # usage: util/check.sh [directory]
  5. #
  6. # This script runs lzotest with all algorithms
  7. # on a complete directory tree.
  8. # It is not suitable for accurate timings.
  9. #
  10. # Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer
  11. #
  12. if test "X$LZOTEST" = X; then
  13. LZOTEST="./lzotest/lzotest"
  14. for d in ./lzotest .; do
  15. for ext in "" .exe .out; do
  16. if test -f "$d/lzotest$ext" && test -x "$d/lzotest$ext"; then
  17. LZOTEST="$d/lzotest$ext"
  18. break 2
  19. fi
  20. done
  21. done
  22. fi
  23. dir="${1-.}"
  24. TMPFILE="/tmp/lzotest_$$.tmp"
  25. rm -f "$TMPFILE"
  26. (find "$dir/." -type f -print | LC_ALL=C sort > "$TMPFILE") || true
  27. ## methods=`"$LZOTEST" -m | sed -n 's/^ *-m\([0-9]*\).*/\1/p'`
  28. ## methods="9721 9722 9723 9724 9725 9726 9727 9728 9729"
  29. methods="21 31 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 61 71 81"
  30. methods="$methods 111 112 115"
  31. methods="$methods 921 931 901 911"
  32. methods="$methods 902 912 942 962 972 982 992"
  33. ##methods="71 972"
  34. ##methods="1101 1102 1103 1104 1105 1106 1107"
  35. LFLAGS="-q -T -n2 -S"
  36. LFLAGS="-q -T -n2"
  37. for m in $methods; do
  38. cat "$TMPFILE" | "$LZOTEST" "-m$m" -@ $LFLAGS
  39. done
  40. rm -f "$TMPFILE"
  41. echo "Done."
  42. exit 0
  43. # vim:set ts=4 sw=4 et: