]> git.sesse.net Git - ffmpeg/blobdiff - tests/regression-funcs.sh
fate: allow specifying relative path to config file in fate.sh
[ffmpeg] / tests / regression-funcs.sh
index 7aa57e0f7e4231db5447d65e6ecc02da83eebff4..970485c87e956f74a4a64ee9be87bf199cce4c73 100755 (executable)
@@ -14,7 +14,8 @@ datadir="./tests/data"
 target_datadir="${target_path}/${datadir}"
 
 this="$test.$test_ref"
-logfile="$datadir/$this.regression"
+logdir="$datadir/regression/$test_ref"
+logfile="$logdir/$test"
 outfile="$datadir/$test_ref/"
 errfile="$datadir/$this.err"
 
@@ -33,21 +34,17 @@ pcm_ref="$datadir/$test_ref.ref.wav"
 crcfile="$datadir/$this.crc"
 target_crcfile="$target_datadir/$this.crc"
 
+cleanfiles="$raw_dst $pcm_dst $crcfile $bench $bench2"
+trap 'rm -f -- $cleanfiles' EXIT
+
 mkdir -p "$datadir"
 mkdir -p "$outfile"
+mkdir -p "$logdir"
 
 [ "${V-0}" -gt 0 ] && echov=echo || echov=:
 [ "${V-0}" -gt 1 ] || exec 2>$errfile
 
-if [ X"$(echo | md5sum 2> /dev/null)" != X ]; then
-    do_md5sum() { md5sum -b $1; }
-elif [ X"$(echo | md5 2> /dev/null)" != X ]; then
-    do_md5sum() { md5 $1 | sed 's#MD5 (\(.*\)) = \(.*\)#\2 *\1#'; }
-elif [ -x /sbin/md5 ]; then
-    do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
-else
-    do_md5sum() { echo No md5sum program found; }
-fi
+. $(dirname $0)/md5.sh
 
 FFMPEG_OPTS="-v 0 -y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
 
@@ -95,7 +92,6 @@ do_ffmpeg_crc()
     $echov $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
     $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
     echo "$f $(cat $crcfile)" >> $logfile
-    rm -f "$crcfile"
 }
 
 do_ffmpeg_nocheck()
@@ -111,7 +107,6 @@ do_ffmpeg_nocheck()
 do_video_decoding()
 {
     do_ffmpeg $raw_dst $1 -i $target_path/$file -f rawvideo $2
-    rm -f $raw_dst
 }
 
 do_video_encoding()