8 base64
=tests
/base64
${HOSTEXECSUF}
16 ref
=${7:-"${base}/ref/fate/${test}"}
19 thread_type
=${10:-frame+slice}
23 size_tolerance
=${14:-0}
27 report_type
=${18:-standard}
30 outdir
="tests/data/fate"
31 outfile
="${outdir}/${test}"
32 errfile
="${outdir}/${test}.err"
33 cmpfile
="${outdir}/${test}.diff"
34 repfile
="${outdir}/${test}.rep"
38 threads_max
=${threads#random}
39 [ -z "$threads_max" ] && threads_max
=16
40 threads
=$
(awk "BEGIN { srand(); print 1+int(rand() * $threads_max) }" < /dev
/null
)
46 test ${1} = ${1#/} && p=${target_path}/
50 # $1=value1, $2=value2, $3=threshold
51 # prints 0 if absolute difference between value1 and value2 is <= threshold
53 awk "BEGIN { v = $1 - $2; printf ((v < 0 ? -v : v) > $3) }"
57 psnr
=$
(tests
/tiny_psnr
${HOSTEXECSUF} "$1" "$2" $cmp_unit $cmp_shift 0) ||
return 1
58 val
=$
(expr "$psnr" : ".*$3: *\([0-9.]*\)")
59 size1
=$
(expr "$psnr" : '.*bytes: *\([0-9]*\)')
60 size2
=$
(expr "$psnr" : '.*bytes:[ 0-9]*/ *\([0-9]*\)')
61 val_cmp
=$
(compare
$val $cmp_target $fuzz)
62 size_cmp
=$
(compare
$size1 $size2 $size_tolerance)
63 if [ "$val_cmp" != 0 ] ||
[ "$size_cmp" != 0 ]; then
65 if [ "$val_cmp" != 0 ]; then
66 echo "$3: |$val - $cmp_target| >= $fuzz"
68 if [ "$size_cmp" != 0 ]; then
69 echo "size: |$size1 - $size2| >= $size_tolerance"
76 do_tiny_psnr
"$1" "$2" MAXDIFF
80 do_tiny_psnr
"$1" "$2" stddev
84 printf '%s\n' "$1" |
diff -u -b - "$2"
88 test "${V:-0}" -gt 0 && echo "$target_exec" $target_path/"$@" >&3
89 $target_exec $target_path/"$@"
93 test "${V:-0}" -gt 0 && echo "$target_exec" $target_path/"$@" >&3
94 $target_exec $target_path/"$@" >&3
98 run ffprobe
${PROGSUF}${EXECSUF} -bitexact -show_entries format
=format_name
-print_format default
=nw
=1:nk
=1 "$@"
102 run ffprobe
${PROGSUF}${EXECSUF} -bitexact -show_entries stream
=codec_name
,codec_time_base
,sample_fmt
,channels
,channel_layout
:side_data
"$@"
106 run ffprobe
${PROGSUF}${EXECSUF} -bitexact -show_entries format_tags
"$@"
110 test "${V:-0}" -gt 0 && echo ${base}/"$@" ${base} >&3
115 run ffprobe${PROGSUF}${EXECSUF} -bitexact -show_frames "$@
"
119 run ffprobe${PROGSUF}${EXECSUF} -bitexact -show_chapters "$@
"
125 run ffprobe${PROGSUF}${EXECSUF} -bitexact -select_streams a -show_entries format=start_time,duration:stream=index,start_pts,duration_ts "$filename" "$@
"
126 pktfile1="${outdir}/${test}.pkts
"
127 framefile1="${outdir}/${test}.frames
"
128 cleanfiles="$cleanfiles $pktfile1 $framefile1"
129 run ffprobe${PROGSUF}${EXECSUF} -bitexact -select_streams a -of compact -count_packets -show_entries packet=pts,dts,duration,flags:stream=nb_read_packets "$filename" "$@
" > "$pktfile1"
130 head -n 8 "$pktfile1"
131 tail -n 9 "$pktfile1"
132 run ffprobe${PROGSUF}${EXECSUF} -bitexact -select_streams a -of compact -count_frames -show_entries frame=pts,pkt_dts,best_effort_timestamp,pkt_duration,nb_samples:stream=nb_read_frames "$filename" "$@
" > "$framefile1"
133 head -n 8 "$framefile1"
134 tail -n 9 "$framefile1"
138 dec_opts="-hwaccel $hwaccel -threads $threads -thread_type $thread_type"
139 ffmpeg_args="-nostdin -nostats -noauto_conversion_filters -cpuflags $cpuflags"
141 [ x${arg} = x-i ] && ffmpeg_args="${ffmpeg_args} ${dec_opts}"
142 ffmpeg_args
="${ffmpeg_args} ${arg}"
144 run ffmpeg
${PROGSUF}${EXECSUF} ${ffmpeg_args}
150 print_filename
=$
(basename "$filename")
151 run ffprobe
${PROGSUF}${EXECSUF} -print_filename "${print_filename}" \
152 -of compact -bitexact -show_format -show_streams -show_packets \
153 -show_data_hash CRC32 "$filename" "$@
"
157 ffmpeg "$@
" -bitexact -f framecrc -
161 ffmpeg "$@
" -bitexact -f ffmetadata -
165 ffmpeg "$@
" -bitexact -f framemd5 -
177 encfile="${outdir}/${test}.out
"
178 cleanfiles="$cleanfiles $encfile"
179 ffmpeg -y "$@
" $(target_path $encfile) || return
180 do_md5sum $encfile | awk '{print $1}'
184 ffmpeg -auto_conversion_filters "$@
" -vn -f s16le -
190 ffmpeg -bitexact "$@
" -bitexact -f $fmt -
197 src_file=$(target_path $4)
199 encfile="${outdir}/${test}.${out_fmt}"
201 encfile=$(target_path ${encfile})
202 ffmpeg -auto_conversion_filters -i $src_file "$@
" -f $out_fmt -y ${encfile} || return
203 ffmpeg -auto_conversion_filters -bitexact -i ${encfile} -c:a pcm_${pcm_fmt} -fflags +bitexact -f ${dec_fmt} -
206 SCALE_FLAGS="+accurate_rnd
+bitexact
"
207 FLAGS="-flags +bitexact
-sws_flags $SCALE_FLAGS -fflags +bitexact
"
208 DEC_OPTS="-threads $threads -thread_type $thread_type -idct simple
$FLAGS"
209 ENC_OPTS="-threads 1 -idct simple
-dct fastint
"
221 encfile="${outdir}/${test}.${enc_fmt_out}"
222 decfile="${outdir}/${test}.out.${dec_fmt_out}"
223 cleanfiles="$cleanfiles $decfile"
224 test "$keep" -ge 1 || cleanfiles="$cleanfiles $encfile"
225 tsrcfile=$(target_path $srcfile)
226 tencfile=$(target_path $encfile)
227 tdecfile=$(target_path $decfile)
229 if [ -n "$twopass" ]; then
230 logfile_prefix="${outdir}/${test}.pass1
"
231 cleanfiles="$cleanfiles ${logfile_prefix}-0.log
"
232 tlogfile_prefix=$(target_path $logfile_prefix)
233 ffmpeg -auto_conversion_filters -f $enc_fmt_in $DEC_OPTS -i $tsrcfile \
234 $ENC_OPTS $enc_opt_out $FLAGS -pass 1 -passlogfile $tlogfile_prefix \
235 -f $enc_fmt_out -y $tencfile || return
236 enc_opt_out="$enc_opt_out -pass 2 -passlogfile $tlogfile_prefix"
239 ffmpeg -auto_conversion_filters -f $enc_fmt_in $DEC_OPTS -i $tsrcfile $ENC_OPTS $enc_opt_out $FLAGS \
240 -f $enc_fmt_out -y $tencfile || return
242 echo $(wc -c $encfile)
243 ffmpeg -auto_conversion_filters $dec_opt_in $DEC_OPTS -i $tencfile $ENC_OPTS $dec_opt_out $FLAGS \
244 -f $dec_fmt_out -y $tdecfile || return
246 tests/tiny_psnr${HOSTEXECSUF} $srcfile $decfile $cmp_unit $cmp_shift
247 test -z "$ffprobe_opts" || \
248 run ffprobe${PROGSUF}${EXECSUF} -bitexact $ffprobe_opts $tencfile || return
261 test -z "$additional_input" || additional_input="$DEC_OPTS $additional_input"
262 encfile="${outdir}/${test}.${enc_fmt}"
263 test $keep -ge 1 || cleanfiles="$cleanfiles $encfile"
264 tsrcfile=$(target_path $srcfile)
265 tencfile=$(target_path $encfile)
266 ffmpeg -f $src_fmt $DEC_OPTS $enc_opt_in -i $tsrcfile $additional_input \
267 $ENC_OPTS $enc_opt $FLAGS -f $enc_fmt -y $tencfile || return
269 echo $(wc -c $encfile)
270 ffmpeg $DEC_OPTS $final_decode -i $tencfile $ENC_OPTS $FLAGS $final_encode \
271 -f framecrc - || return
272 test -z "$ffprobe_opts" || \
273 run ffprobe${PROGSUF}${EXECSUF} -bitexact $ffprobe_opts $tencfile || return
282 tsrcfile=$(target_path $srcfile)
283 ffmpeg $DEC_OPTS -f $src_fmt $src_opts -i $tsrcfile $ENC_OPTS $FLAGS $enc_opts \
284 -f framecrc - || return
285 test -z "$ffprobe_opts" || \
286 run ffprobe${PROGSUF}${EXECSUF} -bitexact $ffprobe_opts $tsrcfile || return
298 encfile="${outdir}/${test}.${enc_fmt}"
299 test $keep -ge 1 || cleanfiles="$cleanfiles $encfile"
300 tsrcfile=$(target_path $srcfile)
301 tencfile=$(target_path $encfile)
302 ffmpeg -f $src_fmt $src_opts -i $tsrcfile $stream_maps -codec copy $FLAGS \
303 -f $enc_fmt -y $tencfile || return
304 ffmpeg $DEC_OPTS $final_decode -i $tencfile $ENC_OPTS $FLAGS $final_encode \
305 -f framecrc - || return
306 test -z "$ffprobe_opts" || \
307 run ffprobe${PROGSUF}${EXECSUF} -bitexact $ffprobe_opts $tencfile || return
310 # this function is for testing external encoders,
311 # where the precise output is not controlled by us
312 # we can still test e.g. that the output can be decoded correctly
319 srcfile=$(target_path $srcfile)
320 encfile=$(target_path "${outdir}/${test}.${enc_fmt}")
322 ffmpeg -i $srcfile $enc_opt -f $enc_fmt -y $encfile || return
323 run ffprobe${PROGSUF}${EXECSUF} -bitexact $probe_opt $encfile || return
326 # FIXME: There is a certain duplication between the avconv-related helper
327 # functions above and below that should be refactored.
328 ffmpeg2="$target_exec ${target_path}/ffmpeg${PROGSUF}${EXECSUF}"
329 raw_src="${target_path}/tests
/vsynth
1/%02d.pgm
"
330 pcm_src="${target_path}/tests
/data
/asynth1.sw
"
332 [ "${V-0}" -gt 0 ] && echov=echov || echov=:
338 AVCONV_OPTS="-nostdin -nostats -noauto_conversion_filters -y -cpuflags $cpuflags -filter_threads $threads"
339 COMMON_OPTS="-flags +bitexact
-idct simple
-sws_flags $SCALE_FLAGS -fflags +bitexact
"
340 DEC_OPTS="$COMMON_OPTS -threads $threads"
341 ENC_OPTS="$COMMON_OPTS -threads 1 -dct fastint
"
344 $echov $ffmpeg2 $AVCONV_OPTS $*
345 $ffmpeg2 $AVCONV_OPTS $*
351 set -- $* ${target_path}/$f
352 run_avconv $* || return
361 run_avconv $* -f crc -
366 outdir="tests
/data
/lavf
"
367 file=${outdir}/lavf.$t
368 test "$keep" -ge 1 || cleanfiles="$cleanfiles $file"
369 do_avconv $file -auto_conversion_filters $DEC_OPTS $1 -ar 44100 -f s16le -i $pcm_src \
370 "$ENC_OPTS -metadata title
=lavftest
" -t 1 -qscale 10 $2 || return
371 test "$4" = "disable_crc
" ||
372 do_avconv_crc $file -auto_conversion_filters $DEC_OPTS $3 -i $target_path/$file
377 outdir="tests
/data
/lavf
"
378 file=${outdir}/lavf.$t
379 test "$keep" -ge 1 || cleanfiles="$cleanfiles $file"
380 do_avconv $file -auto_conversion_filters $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $DEC_OPTS \
381 -ar 44100 -f s16le $1 -i $pcm_src "$ENC_OPTS -metadata title
=lavftest
" -b:a 64k -t 1 -qscale:v 10 $2 || return
382 test "$3" = "disable_crc
" ||
383 do_avconv_crc $file -auto_conversion_filters $DEC_OPTS -i $target_path/$file $3
386 lavf_container_attach() { lavf_container "" "$1 -attach ${raw_src%/*}/00.pgm
-metadata:s
:t mimetype
=image
/x-portable-greymap
"; }
387 lavf_container_timecode_nodrop() { lavf_container "" "$1 -timecode 02:56:14:13"; }
388 lavf_container_timecode_drop() { lavf_container "" "$1 -timecode 02:56:14.13 -r 30000/1001"; }
390 lavf_container_timecode()
392 lavf_container_timecode_nodrop "$@
"
393 lavf_container_timecode_drop "$@
"
394 lavf_container "" "$1"
397 lavf_container_fate()
399 t="${test#lavf-fate-}"
400 outdir="tests
/data
/lavf-fate
"
401 file=${outdir}/lavf.$t
402 cleanfiles="$cleanfiles $file"
403 input="${target_samples}/$1"
404 do_avconv $file -auto_conversion_filters $DEC_OPTS $2 -i "$input" \
405 "$ENC_OPTS -metadata title
=lavftest
" $3 -vcodec copy -acodec copy || return
406 do_avconv_crc $file -auto_conversion_filters $DEC_OPTS -i $target_path/$file $4
410 no_file_checksums="$3"
413 outdir="tests
/data
/images
/$t"
415 file=${outdir}/%02d.$t
416 if [ "$keep" -lt 1 ]; then
417 for i in `seq $nb_frames`; do
418 filename=`printf "$file" $i`
419 cleanfiles="$cleanfiles $filename"
422 run_avconv $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $1 \
423 "$ENC_OPTS -metadata title
=lavftest
" -vf scale -frames $nb_frames \
424 -y -qscale 10 $target_path/$file || return
425 if [ -z "$no_file_checksums" ]; then
426 do_md5sum ${outdir}/02.$t
427 echo $(wc -c ${outdir}/02.$t)
429 do_avconv_crc $file -auto_conversion_filters $DEC_OPTS $2 -i $target_path/$file $2
435 outdir="tests
/data
/lavf
"
436 file=${outdir}/${t}pipe.$t
437 do_avconv $file -auto_conversion_filters $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src \
438 -f image2pipe "$ENC_OPTS -metadata title
=lavftest
" -t 1 -qscale 10 || return
439 do_avconv_crc $file -auto_conversion_filters $DEC_OPTS -f image2pipe -i $target_path/$file
444 outdir="tests
/data
/lavf
"
445 file=${outdir}/lavf.$t
446 test "$keep" -ge 1 || cleanfiles="$cleanfiles $file"
447 do_avconv $file -auto_conversion_filters $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src \
448 "$ENC_OPTS -metadata title
=lavftest
" -t 1 -qscale 10 $1 $2 || return
449 do_avconv_crc $file -auto_conversion_filters $DEC_OPTS -i $target_path/$file $1
456 ffmpeg -auto_conversion_filters $FLAGS $ENC_OPTS \
457 -lavfi "testsrc2
=size
=300x200
:rate
=1:duration
=5,format
=${pixfmt},split[ref
][tmp
];[tmp
]avgblur
=4[enc
];[enc
][ref
]${refcmp},metadata
=print
:file=-" \
458 -f null /dev/null | awk -v ref=${ref} -v fuzz=${fuzz} -f ${base}/refcmp-metadata.awk -
465 ffmpeg $FLAGS $ENC_OPTS \
466 -lavfi "testsrc2
=size
=300x200
:rate
=1:duration
=5,format
=${pixfmt},${refcmp},metadata
=print
:file=-" \
467 -f null /dev/null | awk -v ref=${ref} -v fuzz=${fuzz} -f ${base}/refcmp-metadata.awk -
470 refcmp_metadata_files(){
476 ffmpeg -auto_conversion_filters $FLAGS -i $file1 $FLAGS -i $file2 $ENC_OPTS \
477 -lavfi "[0:v
]format
=${pixfmt}[v0];[1:v]format=${pixfmt}[v1];[v0][v1]${refcmp},metadata
=print
:file=-" \
478 -f null /dev/null | awk -v ref=${ref} -v fuzz=${fuzz} -f ${base}/refcmp-metadata.awk -
481 refcmp_metadata_transcode(){
487 encfile="${outdir}/${test}.${enc_ext}"
488 cleanfiles="$cleanfiles $encfile"
489 tsrcfile=$(target_path $srcfile)
490 tencfile=$(target_path $encfile)
491 ffmpeg $DEC_OPTS -i $tsrcfile $ENC_OPTS $enc_opt $FLAGS -y -f $enc_fmt $tencfile || return
492 refcmp_metadata_files $tencfile $tsrcfile "$@
"
496 conversion="${test#pixfmt-}"
497 outdir="tests
/data
/pixfmt
"
498 raw_dst="$outdir/$conversion.out.yuv
"
499 file=${outdir}/${conversion}.yuv
500 cleanfiles="$cleanfiles $raw_dst $file"
501 run_avconv $DEC_OPTS -r 1 -f image2 -c:v pgmyuv -i $raw_src \
502 $ENC_OPTS -f rawvideo -t 1 -s 352x288 -pix_fmt $conversion $target_path/$raw_dst || return
503 do_avconv $file $DEC_OPTS -f rawvideo -s 352x288 -pix_fmt $conversion -i $target_path/$raw_dst \
504 $ENC_OPTS -f rawvideo -s 352x288 -pix_fmt yuv444p -color_range mpeg
507 pixfmt_conversion_ext(){
510 color_range="${test#pixfmt-}"
511 color_range=${color_range%-*}
512 conversion="${test#pixfmt-$color_range-}"
513 outdir="tests
/data
/pixfmt
"
514 file=${outdir}/${color_range}-${conversion}.yuv
515 cleanfiles="$cleanfiles $file"
516 do_avconv $file $DEC_OPTS -lavfi ${prefix}testsrc=s=352x288,format=${color_range},scale=flags=$SCALE_FLAGS:sws_dither=none,format=$conversion \
517 $ENC_OPTS -t 1 -f rawvideo -s 352x288 -pix_fmt ${color_range}${suffix} -color_range mpeg
521 pix_fmt=${test#filter-pixdesc-}
522 label=${test#filter-}
523 raw_src="${target_path}/tests
/vsynth
1/%02d.pgm
"
525 md5file1="${outdir}/${test}-1.md5
"
526 md5file2="${outdir}/${test}-2.md5
"
527 cleanfiles="$cleanfiles $md5file1 $md5file2"
529 ffmpeg $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src \
530 $FLAGS $ENC_OPTS -vf "scale
,format
=$pix_fmt" -vcodec rawvideo -frames:v 5 \
531 "-pix_fmt $pix_fmt" -f nut md5:$md5file1
532 ffmpeg $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src \
533 $FLAGS $ENC_OPTS -vf "scale
,format
=$pix_fmt,pixdesctest
" -vcodec rawvideo -frames:v 5 \
534 "-pix_fmt $pix_fmt" -f nut md5:$md5file2
536 diff -q $md5file1 $md5file2 || return
537 printf '%-20s' $label
544 label=${test#filter-}
545 raw_src="${target_path}/tests
/vsynth
1/%02d.pgm
"
546 printf '%-20s' $label
547 ffmpeg $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src \
548 $FLAGS $ENC_OPTS -vf "$filters" -vcodec rawvideo -frames:v 5 $* -f nut md5:
552 filter=${test#filter-pixfmts-}
558 showfiltfmts="$target_exec $target_path/libavfilter
/tests
/filtfmts
${EXECSUF}"
559 scale_exclude_fmts=${outfile}_scale_exclude_fmts
560 scale_in_fmts=${outfile}_scale_in_fmts
561 scale_out_fmts=${outfile}_scale_out_fmts
562 in_fmts=${outfile}_in_fmts
564 # exclude pixel formats which are not supported as input
565 $showfiltfmts scale | awk -F '[ \r]' '/^INPUT/{ fmt=substr($3, 5); print fmt }' | sort >$scale_in_fmts
566 $showfiltfmts scale | awk -F '[ \r]' '/^OUTPUT/{ fmt=substr($3, 5); print fmt }' | sort >$scale_out_fmts
567 comm -12 $scale_in_fmts $scale_out_fmts >$scale_exclude_fmts
569 $showfiltfmts $filter | awk -F '[ \r]' '/^INPUT/{ fmt=substr($3, 5); print fmt }' | sort >$in_fmts
570 pix_fmts=$(comm -12 $scale_exclude_fmts $in_fmts)
573 for pix_fmt in $pix_fmts; do
575 video_filter "${prefilter_chain}scale
,format
=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt -frames:v $nframes || return
578 rm $in_fmts $scale_in_fmts $scale_out_fmts $scale_exclude_fmts
583 sample=$(target_path $1)
586 decfile1="${outdir}/${test}.out-1
"
587 decfile2="${outdir}/${test}.out-2
"
588 decfile3="${outdir}/${test}.out-3
"
589 cleanfiles="$cleanfiles $decfile1 $decfile2 $decfile3"
592 ffmpeg -auto_conversion_filters $extra_args -i "$sample" \
593 -bitexact -c:a copy -f framecrc -y $(target_path $decfile1) || return
595 # test decoded (and cut) data
596 ffmpeg -auto_conversion_filters $extra_args -i "$sample" -bitexact -f wav md5: || return
597 # the same as above again, with seeking to the start
598 ffmpeg -auto_conversion_filters $extra_args -ss 0 -seek_timestamp 1 -i "$sample" \
599 -bitexact -c:a copy -f framecrc -y $(target_path $decfile2) || return
601 ffmpeg -auto_conversion_filters $extra_args -ss 0 -seek_timestamp 1 -i "$sample" \
602 -bitexact -f wav md5: || return
603 # test packet data, with seeking to a specific position
604 ffmpeg -auto_conversion_filters $extra_args -ss 5 -seek_timestamp 1 -i "$sample" \
605 -bitexact -c:a copy -f framecrc -y $(target_path $decfile3) || return
610 sample=$(target_path $1)
614 file1="${outdir}/${test}.out-1
"
615 cleanfiles="$cleanfiles $file1"
617 # test data after reencoding
618 ffmpeg -i "$sample" -bitexact -map 0:a -c:a $codec -af aresample \
619 -f $format -y "$
(target_path
"$file1")" || return
620 probegaplessinfo "$
(target_path
"$file1")"
624 sample=$(target_path $1)
628 decfile="${outdir}/${test}.wav
"
629 cleanfiles="$cleanfiles $decfile"
631 ffmpeg -auto_conversion_filters -i "$sample" -bitexact $extra_args -y $(target_path $decfile) || return
632 tests/audiomatch${HOSTEXECSUF} $decfile $trefile
641 concatfile="${outdir}/${test}.ffconcat
"
642 packetfile="${outdir}/${test}.ffprobe
"
643 cleanfiles="$concatfile $packetfile"
645 awk "{gsub
(/%SRCFILE
%/, \"$sample\"); print
}" $template > $concatfile
647 if [ "$mode" = "md5
" ]; then
648 run ffprobe${PROGSUF}${EXECSUF} -bitexact -show_streams -show_packets -safe 0 $extra_args $(target_path $concatfile) | tr -d '\r' > $packetfile
649 do_md5sum $packetfile
651 run ffprobe${PROGSUF}${EXECSUF} -bitexact -show_streams -show_packets -of compact=p=0:nk=1 -safe 0 $extra_args $(target_path $concatfile)
659 run tools/venc_data_dump${EXECSUF} ${file} ${stream} ${frames} ${threads} ${thread_type}
666 # Disable globbing: command arguments may contain globbing characters and
667 # must be kept verbatim
671 eval $command >"$outfile" 2>$errfile
674 if [ $err -gt 128 ]; then
675 sig=$(kill -l $err 2>/dev/null)
676 test "${sig}" = "${sig%[!A-Za-z]*}" || unset sig
679 if test -e "$ref" || test $cmp = "oneline
" || test $cmp = "null
" || test $cmp = "grep" ; then
681 diff) diff -u -b "$ref" "$outfile" >$cmpfile ;;
682 rawdiff)diff -u "$ref" "$outfile" >$cmpfile ;;
683 oneoff) oneoff "$ref" "$outfile" >$cmpfile ;;
684 stddev) stddev "$ref" "$outfile" >$cmpfile ;;
685 oneline)oneline "$ref" "$outfile" >$cmpfile ;;
686 grep) grep "$ref" "$errfile" >$cmpfile ;;
687 null) cat "$outfile" >$cmpfile ;;
690 test $err = 0 && err=$cmperr
691 if [ "$report_type" = "ignore
" ]; then
692 test $err = 0 || echo "IGNORE
\t${test}" && err=0 && unset sig
694 test $err = 0 || cat $cmpfile
697 echo "reference
file '$ref' not found
"
701 if [ $err -eq 0 ] && test $report_type = "standard
" ; then
704 echo "threads
=$threads" >> "$errfile"
705 cmpo="$
($base64 <$cmpfile)"
706 erro="$
($base64 <$errfile)"
708 echo "${test}:${sig:-$err}:$cmpo:$erro" >$repfile
710 if test $err != 0 && test $gen != "no
" && test "${ref#tests/data/}" = "$ref" ; then
712 cp -f "$outfile" "$ref"
716 if test $err = 0; then
717 if test $keep -lt 2; then
718 rm -f $outfile $errfile $cmpfile $cleanfiles
720 elif test $gen = "no
"; then
721 echo "Test
$test failed. Look
at $errfile for details.
"
722 test "${V:-0}" -gt 0 && cat $errfile
724 echo "Updating reference failed
, possibly no output
file was generated.
"