kusano 7d535a
#! /bin/sh
kusano 7d535a
set -e
kusano 7d535a
kusano 7d535a
#
kusano 7d535a
# usage: util/checkasm.sh [directory]
kusano 7d535a
#
kusano 7d535a
# This script runs lzotest with all assembler decompressors
kusano 7d535a
# on a complete directory tree.
kusano 7d535a
# It is not suitable for accurate timings.
kusano 7d535a
#
kusano 7d535a
# Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
#
kusano 7d535a
kusano 7d535a
LZOTEST="lzotest"
kusano 7d535a
test -x ./lzotest/lzotest && LZOTEST="./lzotest/lzotest"
kusano 7d535a
test -x ./lzotest.exe && LZOTEST="./lzotest.exe"
kusano 7d535a
test -x ./lzotest.out && LZOTEST="./lzotest.out"
kusano 7d535a
LFLAGS="-q"
kusano 7d535a
kusano 7d535a
dir="${*-.}"
kusano 7d535a
kusano 7d535a
TMPFILE="/tmp/lzo_$$.tmp"
kusano 7d535a
rm -f $TMPFILE
kusano 7d535a
(find $dir/ -type f -print > $TMPFILE) || true
kusano 7d535a
kusano 7d535a
for i in 11; do
kusano 7d535a
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A
kusano 7d535a
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A -S
kusano 7d535a
done
kusano 7d535a
kusano 7d535a
for i in 61; do
kusano 7d535a
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F
kusano 7d535a
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F -S
kusano 7d535a
done
kusano 7d535a
kusano 7d535a
for i in 71 81; do
kusano 7d535a
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A
kusano 7d535a
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A -S
kusano 7d535a
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F
kusano 7d535a
    cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F -S
kusano 7d535a
done
kusano 7d535a
kusano 7d535a
rm -f $TMPFILE
kusano 7d535a
echo "Done."
kusano 7d535a
exit 0
kusano 7d535a