tests: Add a convenience function for video-only lavf tests
authorDiego Biurrun <diego@biurrun.de>
Wed, 8 Aug 2018 20:06:38 +0000 (22:06 +0200)
committerDiego Biurrun <diego@biurrun.de>
Sat, 16 Feb 2019 17:15:55 +0000 (18:15 +0100)
Rename a test in the process for consistency and simplicity and
remove the remnants of the now-unused lavf regression test scripts.

tests/Makefile
tests/fate-run.sh
tests/fate/avformat.mak [deleted file]
tests/fate/lavf-video.mak [new file with mode: 0644]
tests/fate/seek.mak
tests/lavf-regression.sh [deleted file]
tests/ref/lavf/gif
tests/ref/lavf/y4m [new file with mode: 0644]
tests/ref/lavf/yuv4mpeg [deleted file]
tests/ref/seek/lavf-y4m [moved from tests/ref/seek/lavf-yuv4mpeg with 100% similarity]
tests/regression-funcs.sh [deleted file]

index 8a28cbf..76e751c 100644 (file)
@@ -60,11 +60,11 @@ PARSERDEMDEC       = $(call ALLYES, $(1)_PARSER $(2)_DEMUXER $(3)_DECODER)
 include $(SRC_PATH)/tests/fate/acodec.mak
 include $(SRC_PATH)/tests/fate/vcodec.mak
 
-include $(SRC_PATH)/tests/fate/avformat.mak
 include $(SRC_PATH)/tests/fate/lavf-audio.mak
 include $(SRC_PATH)/tests/fate/lavf-container.mak
 include $(SRC_PATH)/tests/fate/lavf-image.mak
 include $(SRC_PATH)/tests/fate/lavf-image2pipe.mak
+include $(SRC_PATH)/tests/fate/lavf-video.mak
 include $(SRC_PATH)/tests/fate/seek.mak
 
 include $(SRC_PATH)/tests/fate/aac.mak
index c8ac6a1..b613678 100755 (executable)
@@ -226,10 +226,12 @@ lavf_image2pipe(){
     do_avconv_crc $file $DEC_OPTS -f image2pipe -i $target_path/$file
 }
 
-lavftest(){
+lavf_video(){
     t="${test#lavf-}"
-    ref=${base}/ref/lavf/$t
-    ${base}/lavf-regression.sh $t lavf tests/vsynth1 "$target_exec" "$target_path" "$threads" "$thread_type" "$cpuflags"
+    outdir="tests/data/lavf"
+    file=${outdir}/lavf.$t
+    do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 $1
+    do_avconv_crc $file $DEC_OPTS -i $target_path/$file $1
 }
 
 pixfmt_conversion(){
diff --git a/tests/fate/avformat.mak b/tests/fate/avformat.mak
deleted file mode 100644 (file)
index 7c984e4..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-FATE_LAVF-$(call ENCDEC,  GIF,                   IMAGE2)             += gif
-FATE_LAVF-$(CONFIG_YUV4MPEGPIPE_MUXER)                               += yuv4mpeg
-
-FATE_LAVF += $(FATE_LAVF-yes:%=fate-lavf-%)
-
-$(FATE_LAVF): $(AREF) $(VREF)
-$(FATE_LAVF): CMD = lavftest
-
-FATE_AVCONV += $(FATE_LAVF)
-fate-lavf:     $(FATE_LAVF)
diff --git a/tests/fate/lavf-video.mak b/tests/fate/lavf-video.mak
new file mode 100644 (file)
index 0000000..d964e91
--- /dev/null
@@ -0,0 +1,13 @@
+FATE_LAVF_VIDEO-$(call ENCDEC,  GIF,        IMAGE2)             += gif
+FATE_LAVF_VIDEO-$(CONFIG_YUV4MPEGPIPE_MUXER)                    += y4m
+
+FATE_LAVF_VIDEO = $(FATE_LAVF_VIDEO-yes:%=fate-lavf-%)
+
+$(FATE_LAVF_VIDEO): CMD = lavf_video
+$(FATE_LAVF_VIDEO): REF = $(SRC_PATH)/tests/ref/lavf/$(@:fate-lavf-%=%)
+$(FATE_LAVF_VIDEO): $(VREF)
+
+fate-lavf-gif: CMD = lavf_video "-pix_fmt rgb24"
+
+FATE_AVCONV += $(FATE_LAVF_VIDEO)
+fate-lavf-video fate-lavf: $(FATE_LAVF_VIDEO)
index 937d284..c7e56f8 100644 (file)
@@ -178,7 +178,7 @@ FATE_SEEK_LAVF-$(call ENCDEC,  TIFF,                  IMAGE2)      += tiff
 FATE_SEEK_LAVF-$(call ENCDEC2, MPEG2VIDEO, MP2,       MPEGTS)      += ts
 FATE_SEEK_LAVF-$(call ENCDEC,  PCM_U8,                VOC)         += voc
 FATE_SEEK_LAVF-$(call ENCDEC,  PCM_S16LE,             WAV)         += wav
-FATE_SEEK_LAVF-$(CONFIG_YUV4MPEGPIPE_MUXER)                        += yuv4mpeg
+FATE_SEEK_LAVF-$(CONFIG_YUV4MPEGPIPE_MUXER)                        += y4m
 
 fate-seek-lavf-aiff:     SRC = lavf/lavf.aiff
 fate-seek-lavf-al:       SRC = lavf/lavf.al
@@ -214,7 +214,7 @@ fate-seek-lavf-tiff:     SRC = images/tiff/%02d.tiff
 fate-seek-lavf-ts:       SRC = lavf/lavf.ts
 fate-seek-lavf-voc:      SRC = lavf/lavf.voc
 fate-seek-lavf-wav:      SRC = lavf/lavf.wav
-fate-seek-lavf-yuv4mpeg: SRC = lavf/lavf.y4m
+fate-seek-lavf-y4m:      SRC = lavf/lavf.y4m
 
 FATE_SEEK += $(FATE_SEEK_LAVF-yes:%=fate-seek-lavf-%)
 
diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh
deleted file mode 100755 (executable)
index 4e346e2..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# automatic regression test for libavformat
-#
-#
-#set -x
-
-set -e
-
-. $(dirname $0)/regression-funcs.sh
-
-eval do_$test=y
-
-# streamed images
-# mjpeg
-#file=${outfile}lavf.mjpeg
-#do_avconv $file -t 1 -qscale 10 -f image2 -c:v pgmyuv -i $raw_src
-#do_avconv_crc $file -i $target_path/$file
-
-if [ -n "$do_gif" ] ; then
-file=${outfile}lavf.gif
-do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24
-do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
-fi
-
-if [ -n "$do_yuv4mpeg" ] ; then
-file=${outfile}lavf.y4m
-do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10
-do_avconv_crc $file -i $target_path/$file
-fi
index 4a4ebfb..f28dc55 100644 (file)
@@ -1,3 +1,3 @@
-e6089fd4ef3b9df44090ab3650bdd810 *./tests/data/lavf/lavf.gif
-2906401 ./tests/data/lavf/lavf.gif
-./tests/data/lavf/lavf.gif CRC=0xe5605ff6
+e6089fd4ef3b9df44090ab3650bdd810 *tests/data/lavf/lavf.gif
+2906401 tests/data/lavf/lavf.gif
+tests/data/lavf/lavf.gif CRC=0xe5605ff6
diff --git a/tests/ref/lavf/y4m b/tests/ref/lavf/y4m
new file mode 100644 (file)
index 0000000..82c7087
--- /dev/null
@@ -0,0 +1,3 @@
+ec8178cb152f9cdbfd9cb724d977db2e *tests/data/lavf/lavf.y4m
+3801808 tests/data/lavf/lavf.y4m
+tests/data/lavf/lavf.y4m CRC=0x0a941f26
diff --git a/tests/ref/lavf/yuv4mpeg b/tests/ref/lavf/yuv4mpeg
deleted file mode 100644 (file)
index 367b376..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-ec8178cb152f9cdbfd9cb724d977db2e *./tests/data/lavf/lavf.y4m
-3801808 ./tests/data/lavf/lavf.y4m
-./tests/data/lavf/lavf.y4m CRC=0x0a941f26
diff --git a/tests/regression-funcs.sh b/tests/regression-funcs.sh
deleted file mode 100755 (executable)
index fad2057..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-#
-# common regression functions for avconv
-#
-#
-
-test="${1#regtest-}"
-test_ref=$2
-raw_src_dir=$3
-target_exec=$4
-target_path=$5
-threads=${6:-1}
-cpuflags=${8:-all}
-
-datadir="./tests/data"
-target_datadir="${target_path}/${datadir}"
-
-this="$test.$test_ref"
-outfile="$datadir/$test_ref/"
-
-# various files
-avconv="$target_exec ${target_path}/avconv"
-raw_src="${target_path}/$raw_src_dir/%02d.pgm"
-raw_dst="$datadir/$this.out.yuv"
-pcm_src="$target_datadir/asynth1.sw"
-crcfile="$datadir/$this.crc"
-target_crcfile="$target_datadir/$this.crc"
-
-cleanfiles="$raw_dst $crcfile"
-trap 'rm -f -- $cleanfiles' EXIT
-
-[ "${V-0}" -gt 0 ] && echov=echov || echov=:
-
-echov(){
-    echo "$@" >&3
-}
-
-. $(dirname $0)/md5.sh
-
-AVCONV_OPTS="-nostats -y -cpuflags $cpuflags"
-COMMON_OPTS="-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact"
-DEC_OPTS="$COMMON_OPTS -threads $threads"
-ENC_OPTS="$COMMON_OPTS -threads 1 -dct fastint"
-
-run_avconv()
-{
-    $echov $avconv $AVCONV_OPTS $*
-    $avconv $AVCONV_OPTS $*
-}
-
-do_avconv()
-{
-    f="$1"
-    shift
-    set -- $* ${target_path}/$f
-    run_avconv $*
-    do_md5sum $f
-    echo $(wc -c $f)
-}
-
-do_avconv_crc()
-{
-    f="$1"
-    shift
-    run_avconv $* -f crc "$target_crcfile"
-    echo "$f $(cat $crcfile)"
-}