* updated svt-av1 (2.1.0 -> 2.2.1)
[t2sde.git] / tests / run
blob2685990d367fc3a54db321aa77a80ddf4b219950
1 #!/bin/bash
3 # Copyright (C) 2004-2024 René Rebe, ExactCODE GmbH; Germany.
5 verbose=0
6 time=0
7 tee=cat
9 if [ "$1" = -v ]; then
10 verbose=1
11 shift
14 if [ "$1" = -v ]; then
15 verbose=2
16 shift
19 if [ "$1" = -t ]; then
20 time=1
21 shift
25 tmp=`mktemp || mktemp -t tmp.XXXXXXXXXX`
26 errors=0
28 [ "$1" ] || set -- *.cmd
30 [ "$verbose" -gt 1 ] && tee="tee /dev/tty"
32 for x; do
33 x=${x%.cmd}
34 printf "Running test $x ..."
35 /bin/bash $PWD/$x.cmd 2>&1 | $tee > $tmp
36 error=${PIPESTATUS[0]}
38 if [ $error = 42 ]; then
39 echo " NAT"
40 elif [ $error = 43 ]; then
41 echo " N/A"
42 elif [ ! -f $x.out -a $error != 0 ]; then
43 echo " Failed (as expected)"
44 elif [ ! -f $x.out ]; then
45 echo " Passed (unexpected)"
46 cp $tmp $x.out
47 : $((errors++))
48 elif [ $error = 0 ] && grep -q "==NO-DIFF==" $x.out; then
49 echo " Passed"
50 elif cmp $tmp $x.out 2>&1 >/dev/null; then
51 echo " Passed"
52 else
53 echo " Failed !!!"
54 [ $verbose -gt 0 ] && diff -ua $x.out $tmp
55 : $((errors++))
57 done
59 if [ $errors -ne 0 ]; then
60 echo -e "\n\t$errors error(s) total!\n"
61 [ $time -ne 0 ] && echo "(timing supressed due to errors)"
62 elif [ $time -ne 0 ]; then
63 echo "Timing:"
64 time for x in *.cmd ; do
65 x=${x%.cmd}
66 echo -n . >&2
67 $1 -f $x.sed > $tmp
68 done
71 rm -f $tmp