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