Update to MPlayer SVN rev 34578.
[vaapi:mplayer.git] / tests / faterun.sh
1 #!/bin/sh
2 if [ -z "$FATE_SAMPLES" ] ; then
3   echo "FATE_SAMPLES is not set!"
4   exit 1
5 fi
6
7 sample="$1"
8 md5out="tests/res/$sample.md5"
9 ref_file="tests/ref/$sample.md5"
10 options="-noconfig all -lavdopts threads=4:bitexact:idct=2 -really-quiet -noconsolecontrols -nosound -benchmark"
11 if [ -z ${sample##h264-conformance/*} ] ; then
12   # these files generally only work when a fps is given explicitly
13   options="$options -fps 25"
14 fi
15 echo "testing $sample"
16
17 # create necessary files and run
18 mkdir -p $(dirname "$md5out")
19 touch "$md5out"
20 ./mplayer $options -vo md5sum:outfile="$md5out" "$FATE_SAMPLES/$sample"
21
22 # check result
23 if ! [ -e "$ref_file" ] ; then
24   touch tests/ref/empty.md5
25   ref_file=tests/ref/empty.md5
26 fi
27 if ! diff -uw "$ref_file" "$md5out" ; then
28   mv "$md5out" "$md5out.bad"
29   exit 1
30 fi