[19/20] tests: Add a convenience function for video-only lavf tests

Message ID 20180920084729.4523-20-diego@biurrun.de
State New
Headers show
Series
  • [01/20] tests: Use more consistent names for tests
Related show

Commit Message

Diego Biurrun Sept. 20, 2018, 8:47 a.m.
---
 tests/fate-run.sh       |  7 +++++++
 tests/fate/avformat.mak | 20 +++++++++++---------
 tests/ref/lavf/gif      |  6 +++---
 tests/ref/lavf/y4m      |  6 +++---
 4 files changed, 24 insertions(+), 15 deletions(-)

Patch

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 2626a894a0..cb44b21e0e 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -195,6 +195,13 @@  audio_only(){
     do_avconv_crc $file $DEC_OPTS $3 -i $target_path/$file
 }
 
+video_only(){
+    t="${test#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
+}
+
 image_formats(){
     t="${test#lavf-}"
     outdir="tests/data/images/$t"
diff --git a/tests/fate/avformat.mak b/tests/fate/avformat.mak
index 4ecbb1d4bf..4c149817bb 100644
--- a/tests/fate/avformat.mak
+++ b/tests/fate/avformat.mak
@@ -1,7 +1,3 @@ 
-FATE_LAVF-$(call ENCDEC,  GIF,                   IMAGE2)             += gif
-FATE_LAVF-$(CONFIG_YUV4MPEGPIPE_MUXER)                               += y4m
-
-
 FATE_LAVF_LAVF-$(call ENCDEC2, MSMPEG4V3,  MP2,       ASF)                += asf
 FATE_LAVF_LAVF-$(call ENCDEC2, MPEG4,      MP2,       AVI)                += avi
 FATE_LAVF_LAVF-$(call ENCDEC2, DVVIDEO,    PCM_S16LE, AVI)                += dv
@@ -96,10 +92,16 @@  $(FATE_LAVF_PIPE): CMD = streamed_images
 $(FATE_LAVF_PIPE): REF = $(SRC_PATH)/tests/ref/lavf/$(@:fate-lavf-%=%)
 $(FATE_LAVF_PIPE): $(VREF)
 
-FATE_LAVF += $(FATE_LAVF-yes:%=fate-lavf-%)
+FATE_LAVF_VIDEO_ONLY-$(call ENCDEC,  GIF,        IMAGE2)             += gif
+FATE_LAVF_VIDEO_ONLY-$(CONFIG_YUV4MPEGPIPE_MUXER)                    += y4m
+
+FATE_LAVF_VIDEO_ONLY = $(FATE_LAVF_VIDEO_ONLY-yes:%=fate-lavf-%)
+
+$(FATE_LAVF_VIDEO_ONLY): CMD = video_only
+$(FATE_LAVF_VIDEO_ONLY): REF = $(SRC_PATH)/tests/ref/lavf/$(@:fate-lavf-%=%)
+$(FATE_LAVF_VIDEO_ONLY): $(VREF)
 
-$(FATE_LAVF): $(AREF) $(VREF)
-$(FATE_LAVF): CMD = lavftest
+fate-lavf-gif: CMD = video_only "-pix_fmt rgb24"
 
-FATE_AVCONV += $(FATE_LAVF) $(FATE_LAVF_AUDIO_ONLY) $(FATE_LAVF_IMAGES) $(FATE_LAVF_LAVF) $(FATE_LAVF_PIPE)
-fate-lavf:     $(FATE_LAVF) $(FATE_LAVF_AUDIO_ONLY) $(FATE_LAVF_IMAGES) $(FATE_LAVF_LAVF) $(FATE_LAVF_PIPE)
+FATE_AVCONV += $(FATE_LAVF_AUDIO_ONLY) $(FATE_LAVF_IMAGES) $(FATE_LAVF_LAVF) $(FATE_LAVF_PIPE) $(FATE_LAVF_VIDEO_ONLY)
+fate-lavf:     $(FATE_LAVF_AUDIO_ONLY) $(FATE_LAVF_IMAGES) $(FATE_LAVF_LAVF) $(FATE_LAVF_PIPE) $(FATE_LAVF_VIDEO_ONLY)
diff --git a/tests/ref/lavf/gif b/tests/ref/lavf/gif
index ca6eb1c1fd..fbec091b83 100644
--- a/tests/ref/lavf/gif
+++ b/tests/ref/lavf/gif
@@ -1,3 +1,3 @@ 
-e6089fd4ef3b9df44090ab3650bdd810 *./tests/data/fate/lavf.gif
-2906401 ./tests/data/fate/lavf.gif
-./tests/data/fate/lavf.gif CRC=0xe5605ff6
+e6089fd4ef3b9df44090ab3650bdd810 *tests/data/fate/lavf.gif
+2906401 tests/data/fate/lavf.gif
+tests/data/fate/lavf.gif CRC=0xe5605ff6
diff --git a/tests/ref/lavf/y4m b/tests/ref/lavf/y4m
index c130e1c7cc..d1b077db3e 100644
--- a/tests/ref/lavf/y4m
+++ b/tests/ref/lavf/y4m
@@ -1,3 +1,3 @@ 
-ec8178cb152f9cdbfd9cb724d977db2e *./tests/data/fate/lavf.y4m
-3801808 ./tests/data/fate/lavf.y4m
-./tests/data/fate/lavf.y4m CRC=0x0a941f26
+ec8178cb152f9cdbfd9cb724d977db2e *tests/data/fate/lavf.y4m
+3801808 tests/data/fate/lavf.y4m
+tests/data/fate/lavf.y4m CRC=0x0a941f26