16 ref
=${7:-"${base}/ref
/fate
/${test}"}
19 thread_type=${10:-frame+slice}
21 outdir="tests
/data
/fate
"
22 outfile="${outdir}/${test}"
23 errfile="${outdir}/${test}.err
"
24 cmpfile="${outdir}/${test}.
diff"
25 repfile="${outdir}/${test}.rep
"
28 psnr=$(tests/tiny_psnr "$1" "$2" 2 0 0)
29 val=$(expr "$psnr" : ".
*$3: *\
([0-9.
]*\
)")
30 size1=$(expr "$psnr" : '.*bytes: *\([0-9]*\)')
31 size2=$(expr "$psnr" : '.*bytes:[ 0-9]*/ *\([0-9]*\)')
32 res=$(echo "if ($val $4 $5) 1" | bc)
33 if [ "$res" != 1 ] || [ $size1 != $size2 ]; then
40 do_tiny_psnr "$1" "$2" MAXDIFF '<=' ${fuzz:-1}
44 do_tiny_psnr "$1" "$2" stddev '<=' ${fuzz:-1}
48 test "${V:-0}" -gt 0 && echo "$target_exec" $target_path/"$@
" >&3
49 $target_exec $target_path/"$@
"
53 run avconv -v 0 -threads $threads -thread_type $thread_type "$@
"
57 avconv "$@
" -f framecrc -
61 avconv "$@
" -f framemd5 -
73 avconv "$@
" -vn -f s16le -
79 ${base}/${1}-regression.sh $t $2 $3 "$target_exec" "$target_path" "$threads" "$thread_type"
83 regtest codec $1 tests/$1
87 regtest lavf lavf tests/vsynth1
91 cleanfiles="tests
/data
/lavfi
/${test#lavfi-}.nut
"
92 regtest lavfi lavfi tests/vsynth1
97 ref=${base}/ref/seek/$t
99 image_*) file="tests
/data
/images
/${t#image_}/%02d.
${t#image_}" ;;
100 *) file=$(echo $t | tr _ '?')
101 for d in acodec vsynth2 lavf; do
102 test -f tests/data/$d/$file && break
104 file=$(echo tests/data/$d/$file)
107 run libavformat/seek-test $target_path/$file
113 $command > "$outfile" 2>$errfile
116 if [ $err -gt 128 ]; then
117 sig=$(kill -l $err 2>/dev/null)
118 test "${sig}" = "${sig%[!A-Za-z]*}" || unset sig
121 if test -e "$ref"; then
123 diff) diff -u -w "$ref" "$outfile" >$cmpfile ;;
124 oneoff) oneoff "$ref" "$outfile" "$fuzz" >$cmpfile ;;
125 stddev) stddev "$ref" "$outfile" "$fuzz" >$cmpfile ;;
126 null) cat "$outfile" >$cmpfile ;;
129 test $err = 0 && err=$cmperr
130 test $err = 0 || cat $cmpfile
132 echo "reference
file '$ref' not found
"
136 echo "${test}:${sig:-$err}:$
($base64 <$cmpfile):$
($base64 <$errfile)" >$repfile
138 test $err = 0 && rm -f $outfile $errfile $cmpfile $cleanfiles