|
|
|
@ -3,6 +3,8 @@ |
|
|
|
|
base=$(dirname $0) |
|
|
|
|
. "${base}/md5.sh" |
|
|
|
|
|
|
|
|
|
base64=tests/base64 |
|
|
|
|
|
|
|
|
|
test="${1#fate-}" |
|
|
|
|
samples=$2 |
|
|
|
|
target_exec=$3 |
|
|
|
@ -15,6 +17,8 @@ fuzz=$8 |
|
|
|
|
outdir="tests/data/fate" |
|
|
|
|
outfile="${outdir}/${test}" |
|
|
|
|
errfile="${outdir}/${test}.err" |
|
|
|
|
cmpfile="${outdir}/${test}.diff" |
|
|
|
|
repfile="${outdir}/${test}.rep" |
|
|
|
|
|
|
|
|
|
do_tiny_psnr(){ |
|
|
|
|
psnr=$(tests/tiny_psnr "$1" "$2" 2 0 0) |
|
|
|
@ -102,17 +106,21 @@ mkdir -p "$outdir" |
|
|
|
|
$command > "$outfile" 2>$errfile |
|
|
|
|
err=$? |
|
|
|
|
|
|
|
|
|
if ! test -e "$ref"; then |
|
|
|
|
echo "reference file '$ref' not found" |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
if test -e "$ref"; then |
|
|
|
|
case $cmp in |
|
|
|
|
diff) diff -u -w "$ref" "$outfile" ;; |
|
|
|
|
oneoff) oneoff "$ref" "$outfile" "$fuzz" ;; |
|
|
|
|
stddev) stddev "$ref" "$outfile" "$fuzz" ;; |
|
|
|
|
diff) diff -u -w "$ref" "$outfile" >$cmpfile ;; |
|
|
|
|
oneoff) oneoff "$ref" "$outfile" "$fuzz" >$cmpfile ;; |
|
|
|
|
stddev) stddev "$ref" "$outfile" "$fuzz" >$cmpfile ;; |
|
|
|
|
esac |
|
|
|
|
|
|
|
|
|
cmperr=$? |
|
|
|
|
test $err = 0 && err=$cmperr |
|
|
|
|
test $err = 0 && rm -f $outfile $errfile $cleanfiles |
|
|
|
|
test $err = 0 || cat $cmpfile |
|
|
|
|
else |
|
|
|
|
echo "reference file '$ref' not found" |
|
|
|
|
err=1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
echo "${test}:${err}:$($base64 <$cmpfile):$($base64 <$errfile)" >$repfile |
|
|
|
|
|
|
|
|
|
test $err = 0 && rm -f $outfile $errfile $cmpfile $cleanfiles |
|
|
|
|
exit $err |
|
|
|
|