summaryrefslogtreecommitdiff
path: root/main/lzo/util/checkasm.sh
blob: 4fee682eb2d344ef9be89f3da1068c434c432278 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#! /bin/sh
set -e

#
# usage: util/checkasm.sh [directory]
#
# This script runs lzotest with all assembler decompressors
# on a complete directory tree.
# It is not suitable for accurate timings.
#
# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
#

LZOTEST="lzotest"
test -x ./lzotest/lzotest && LZOTEST="./lzotest/lzotest"
test -x ./lzotest.exe && LZOTEST="./lzotest.exe"
test -x ./lzotest.out && LZOTEST="./lzotest.out"
LFLAGS="-q"

dir="${*-.}"

TMPFILE="/tmp/lzo_$$.tmp"
rm -f $TMPFILE
(find $dir/ -type f -print > $TMPFILE) || true

for i in 11; do
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A -S
done

for i in 61; do
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F -S
done

for i in 71 81; do
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A -S
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F -S
done

rm -f $TMPFILE
echo "Done."
exit 0