Commit 16cd99bb authored by Måns Rullgård's avatar Måns Rullgård

regtest: suppress console output from tests

This disables all console output from the *-regression.sh scripts by
default.  If the V environment variable is set to 1, ffmpeg commands
are printed before being run.  If V is greater than 1, ffmpeg output
goes to the console, otherwise stderr is redirected to a file.

Originally committed as revision 21253 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 730cb9da
...@@ -28,7 +28,7 @@ do_streamed_images() ...@@ -28,7 +28,7 @@ do_streamed_images()
do_image_formats() do_image_formats()
{ {
file=${outfile}lavf%02d.$1 file=${outfile}lavf%02d.$1
echo $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file $echov $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file
$ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file
do_md5sum ${outfile}lavf02.$1 >> $logfile do_md5sum ${outfile}lavf02.$1 >> $logfile
do_ffmpeg_crc $file $3 -i $target_path/$file do_ffmpeg_crc $file $3 -i $target_path/$file
......
...@@ -17,6 +17,7 @@ target_datadir="${target_path}/${datadir}" ...@@ -17,6 +17,7 @@ target_datadir="${target_path}/${datadir}"
this="$test.$test_ref" this="$test.$test_ref"
logfile="$datadir/$this.regression" logfile="$datadir/$this.regression"
outfile="$datadir/${outfile_prefix}-" outfile="$datadir/${outfile_prefix}-"
errfile="$datadir/$this.err"
# various files # various files
ffmpeg="$target_exec ${target_path}/ffmpeg_g" ffmpeg="$target_exec ${target_path}/ffmpeg_g"
...@@ -33,6 +34,9 @@ pcm_ref="$datadir/$test_ref.ref.wav" ...@@ -33,6 +34,9 @@ pcm_ref="$datadir/$test_ref.ref.wav"
crcfile="$datadir/$this.crc" crcfile="$datadir/$this.crc"
target_crcfile="$target_datadir/$this.crc" target_crcfile="$target_datadir/$this.crc"
[ "${V-0}" -gt 0 ] && echov=echo || echov=:
[ "${V-0}" -gt 1 ] || exec 2>$errfile
if [ X"$(echo | md5sum 2> /dev/null)" != X ]; then if [ X"$(echo | md5sum 2> /dev/null)" != X ]; then
do_md5sum() { md5sum -b $1; } do_md5sum() { md5sum -b $1; }
elif [ X"$(echo | md5 2> /dev/null)" != X ]; then elif [ X"$(echo | md5 2> /dev/null)" != X ]; then
...@@ -50,7 +54,7 @@ do_ffmpeg() ...@@ -50,7 +54,7 @@ do_ffmpeg()
f="$1" f="$1"
shift shift
set -- $* ${target_path}/$f set -- $* ${target_path}/$f
echo $ffmpeg $FFMPEG_OPTS $* $echov $ffmpeg $FFMPEG_OPTS $*
$ffmpeg $FFMPEG_OPTS -benchmark $* > $bench $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench
do_md5sum $f >> $logfile do_md5sum $f >> $logfile
if [ $f = $raw_dst ] ; then if [ $f = $raw_dst ] ; then
...@@ -69,7 +73,7 @@ do_ffmpeg_nomd5() ...@@ -69,7 +73,7 @@ do_ffmpeg_nomd5()
f="$1" f="$1"
shift shift
set -- $* ${target_path}/$f set -- $* ${target_path}/$f
echo $ffmpeg $FFMPEG_OPTS $* $echov $ffmpeg $FFMPEG_OPTS $*
$ffmpeg $FFMPEG_OPTS -benchmark $* > $bench $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench
if [ $f = $raw_dst ] ; then if [ $f = $raw_dst ] ; then
$tiny_psnr $f $raw_ref >> $logfile $tiny_psnr $f $raw_ref >> $logfile
...@@ -86,7 +90,7 @@ do_ffmpeg_crc() ...@@ -86,7 +90,7 @@ do_ffmpeg_crc()
{ {
f="$1" f="$1"
shift shift
echo $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile" $echov $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
$ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile" $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
echo "$f $(cat $crcfile)" >> $logfile echo "$f $(cat $crcfile)" >> $logfile
rm -f "$crcfile" rm -f "$crcfile"
...@@ -96,7 +100,7 @@ do_ffmpeg_nocheck() ...@@ -96,7 +100,7 @@ do_ffmpeg_nocheck()
{ {
f="$1" f="$1"
shift shift
echo $ffmpeg $FFMPEG_OPTS $* $echov $ffmpeg $FFMPEG_OPTS $*
$ffmpeg $FFMPEG_OPTS -benchmark $* > $bench $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench
expr "$(cat $bench)" : '.*utime=\(.*s\)' > $bench2 expr "$(cat $bench)" : '.*utime=\(.*s\)' > $bench2
echo $(cat $bench2) $f >> $benchfile echo $(cat $bench2) $f >> $benchfile
......
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