Commit 40fa14f7 authored by Mans Rullgard's avatar Mans Rullgard Committed by Alex Converse

fate: Add oneline comparison method

Signed-off-by: 's avatarAlex Converse <alex.converse@gmail.com>
parent 64953f67
...@@ -60,6 +60,12 @@ stddev(){ ...@@ -60,6 +60,12 @@ stddev(){
do_tiny_psnr "$1" "$2" stddev do_tiny_psnr "$1" "$2" stddev
} }
oneline(){
val=$(cat "$2")
test x"$val" = x"$1" || { r=$?; printf -- '-%s\n+%s\n' "$ref" "$val"; }
return ${r:-0}
}
run(){ run(){
test "${V:-0}" -gt 0 && echo "$target_exec" $target_path/"$@" >&3 test "${V:-0}" -gt 0 && echo "$target_exec" $target_path/"$@" >&3
$target_exec $target_path/"$@" $target_exec $target_path/"$@"
...@@ -147,11 +153,12 @@ if [ $err -gt 128 ]; then ...@@ -147,11 +153,12 @@ if [ $err -gt 128 ]; then
test "${sig}" = "${sig%[!A-Za-z]*}" || unset sig test "${sig}" = "${sig%[!A-Za-z]*}" || unset sig
fi fi
if test -e "$ref"; then if test -e "$ref" || test $cmp = "oneline" ; then
case $cmp in case $cmp in
diff) diff -u -w "$ref" "$outfile" >$cmpfile ;; diff) diff -u -w "$ref" "$outfile" >$cmpfile ;;
oneoff) oneoff "$ref" "$outfile" >$cmpfile ;; oneoff) oneoff "$ref" "$outfile" >$cmpfile ;;
stddev) stddev "$ref" "$outfile" >$cmpfile ;; stddev) stddev "$ref" "$outfile" >$cmpfile ;;
oneline)oneline "$ref" "$outfile" >$cmpfile ;;
null) cat "$outfile" >$cmpfile ;; null) cat "$outfile" >$cmpfile ;;
esac esac
cmperr=$? cmperr=$?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment