[13/20] tests: Move do_image_formats() to fate-run.sh

Message ID 20180920084729.4523-14-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        | 11 ++++++++
 tests/fate/avformat.mak  | 43 +++++++++++++++++++++-----------
 tests/lavf-regression.sh | 65 ------------------------------------------------
 tests/ref/lavf/bmp       |  6 ++---
 tests/ref/lavf/dpx       |  6 ++---
 tests/ref/lavf/jpg       |  6 ++---
 tests/ref/lavf/pam       |  6 ++---
 tests/ref/lavf/pcx       |  6 ++---
 tests/ref/lavf/pgm       |  6 ++---
 tests/ref/lavf/png       |  6 ++---
 tests/ref/lavf/ppm       |  6 ++---
 tests/ref/lavf/sgi       |  6 ++---
 tests/ref/lavf/sun       |  6 ++---
 tests/ref/lavf/tga       |  6 ++---
 tests/ref/lavf/tiff      |  6 ++---
 tests/ref/lavf/xwd       |  6 ++---
 16 files changed, 78 insertions(+), 119 deletions(-)

Patch

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 63fc9662b7..875b410305 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -195,6 +195,17 @@  audio_only(){
     do_avconv_crc $file $DEC_OPTS $3 -i $target_path/$file
 }
 
+image_formats(){
+    t="${test#lavf-}"
+    outdir="tests/data/images/$t"
+    mkdir -p "$outdir"
+    file=${outdir}/%02d.$t
+    run_avconv $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $1 $ENC_OPTS $2 -frames 12 -y -qscale 10 $target_path/$file
+    do_md5sum ${outdir}/02.$t
+    do_avconv_crc $file $DEC_OPTS $2 -i $target_path/$file
+    echo $(wc -c ${outdir}/02.$t)
+}
+
 streamed_images(){
     t="${test#lavf-}"
     t="${t%pipe}"
diff --git a/tests/fate/avformat.mak b/tests/fate/avformat.mak
index e677a21df5..f35cdcdfea 100644
--- a/tests/fate/avformat.mak
+++ b/tests/fate/avformat.mak
@@ -1,31 +1,18 @@ 
 FATE_LAVF-$(call ENCDEC2, MSMPEG4V3,  MP2,       ASF)                += asf
 FATE_LAVF-$(call ENCDEC2, MPEG4,      MP2,       AVI)                += avi
-FATE_LAVF-$(call ENCDEC,  BMP,                   IMAGE2)             += bmp
-FATE_LAVF-$(call ENCDEC,  DPX,                   IMAGE2)             += dpx
 FATE_LAVF-$(call ENCDEC2, DVVIDEO,    PCM_S16LE, AVI)                += dv
 FATE_LAVF-$(call ENCDEC,  FLV,                   FLV)                += flv
 FATE_LAVF-$(call ENCDEC,  GIF,                   IMAGE2)             += gif
 FATE_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, GXF)                += gxf
-FATE_LAVF-$(call ENCDEC,  MJPEG,                 IMAGE2)             += jpg
 FATE_LAVF-$(call ENCDEC2, MPEG4,      MP2,       MATROSKA)           += mkv
 FATE_LAVF-$(call ENCDEC2, MPEG4,      PCM_ALAW,  MOV)                += mov
 FATE_LAVF-$(call ENCDEC2, MPEG1VIDEO, MP2,       MPEG1SYSTEM MPEGPS) += mpg
 FATE_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF)                += mxf
 FATE_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF_D10 MXF)        += mxf_d10
 FATE_LAVF-$(call ENCDEC2, MPEG4,      MP2,       NUT)                += nut
-FATE_LAVF-$(call ENCDEC,  PAM,                   IMAGE2)             += pam
-FATE_LAVF-$(call ENCDEC,  PCX,                   IMAGE2)             += pcx
-FATE_LAVF-$(call ENCDEC,  PGM,                   IMAGE2)             += pgm
-FATE_LAVF-$(call ENCDEC,  PNG,                   IMAGE2)             += png
-FATE_LAVF-$(call ENCDEC,  PPM,                   IMAGE2)             += ppm
 FATE_LAVF-$(call ENCMUX,  RV10 AC3_FIXED,        RM)                 += rm
-FATE_LAVF-$(call ENCDEC,  SGI,                   IMAGE2)             += sgi
-FATE_LAVF-$(call ENCDEC,  SUNRAST,               IMAGE2)             += sun
 FATE_LAVF-$(call ENCDEC,  FLV,                   SWF)                += swf
-FATE_LAVF-$(call ENCDEC,  TARGA,                 IMAGE2)             += tga
-FATE_LAVF-$(call ENCDEC,  TIFF,                  IMAGE2)             += tiff
 FATE_LAVF-$(call ENCDEC2, MPEG2VIDEO, MP2,       MPEGTS)             += ts
-FATE_LAVF-$(call ENCDEC,  XWD,                   IMAGE2)             += xwd
 FATE_LAVF-$(CONFIG_YUV4MPEGPIPE_MUXER)                               += y4m
 
 FATE_LAVF_AUDIO_ONLY-$(call ENCDEC,  PCM_S16BE,    AIFF)             += aiff
@@ -50,6 +37,32 @@  fate-lavf-al fate-lavf-ul: CMD = audio_only "" "" "-ar 44100"
 fate-lavf-ogg: CMD = audio_only "" "-c:a flac"
 fate-lavf-voc_s16: CMD = audio_only "-ac 2" "-c:a pcm_s16le -f voc"
 
+
+
+FATE_LAVF_IMAGES-$(call ENCDEC,  BMP,            IMAGE2)             += bmp
+FATE_LAVF_IMAGES-$(call ENCDEC,  DPX,            IMAGE2)             += dpx
+FATE_LAVF_IMAGES-$(call ENCDEC,  MJPEG,          IMAGE2)             += jpg
+FATE_LAVF_IMAGES-$(call ENCDEC,  PAM,            IMAGE2)             += pam
+FATE_LAVF_IMAGES-$(call ENCDEC,  PCX,            IMAGE2)             += pcx
+FATE_LAVF_IMAGES-$(call ENCDEC,  PGM,            IMAGE2)             += pgm
+FATE_LAVF_IMAGES-$(call ENCDEC,  PNG,            IMAGE2)             += png
+FATE_LAVF_IMAGES-$(call ENCDEC,  PPM,            IMAGE2)             += ppm
+FATE_LAVF_IMAGES-$(call ENCDEC,  SGI,            IMAGE2)             += sgi
+FATE_LAVF_IMAGES-$(call ENCDEC,  SUNRAST,        IMAGE2)             += sun
+FATE_LAVF_IMAGES-$(call ENCDEC,  TARGA,          IMAGE2)             += tga
+FATE_LAVF_IMAGES-$(call ENCDEC,  TIFF,           IMAGE2)             += tiff
+FATE_LAVF_IMAGES-$(call ENCDEC,  XWD,            IMAGE2)             += xwd
+
+FATE_LAVF_IMAGES = $(FATE_LAVF_IMAGES-yes:%=fate-lavf-%)
+
+$(FATE_LAVF_IMAGES): CMD = image_formats
+$(FATE_LAVF_IMAGES): REF = $(SRC_PATH)/tests/ref/lavf/$(@:fate-lavf-%=%)
+$(FATE_LAVF_IMAGES): $(VREF)
+
+fate-lavf-jpg: CMD = image_formats "-pix_fmt yuvj420p" "-f image2"
+fate-lavf-tiff: CMD = image_formats "-pix_fmt rgb24"
+
+
 FATE_LAVF_PIPE-$(call ENCDEC,  PBM,              IMAGE2PIPE)         += pbmpipe
 FATE_LAVF_PIPE-$(call ENCDEC,  PGM,              IMAGE2PIPE)         += pgmpipe
 FATE_LAVF_PIPE-$(call ENCDEC,  PPM,              IMAGE2PIPE)         += ppmpipe
@@ -66,5 +79,5 @@  FATE_LAVF += fate-lavf-pixfmt
 $(FATE_LAVF): $(AREF) $(VREF)
 $(FATE_LAVF): CMD = lavftest
 
-FATE_AVCONV += $(FATE_LAVF) $(FATE_LAVF_AUDIO_ONLY) $(FATE_LAVF_PIPE)
-fate-lavf:     $(FATE_LAVF) $(FATE_LAVF_AUDIO_ONLY) $(FATE_LAVF_PIPE)
+FATE_AVCONV += $(FATE_LAVF) $(FATE_LAVF_AUDIO_ONLY) $(FATE_LAVF_IMAGES) $(FATE_LAVF_PIPE)
+fate-lavf:     $(FATE_LAVF) $(FATE_LAVF_AUDIO_ONLY) $(FATE_LAVF_IMAGES) $(FATE_LAVF_PIPE)
diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh
index 66248f76d5..d9759af1ef 100755
--- a/tests/lavf-regression.sh
+++ b/tests/lavf-regression.sh
@@ -18,17 +18,6 @@  do_lavf()
     do_avconv_crc $file $DEC_OPTS -i $target_path/$file $3
 }
 
-do_image_formats()
-{
-    outdir="$datadir/images/$test/"
-    mkdir -p "$outdir"
-    file=${outdir}%02d.$test
-    run_avconv $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $1 $ENC_OPTS $2 -frames 12 -y -qscale 10 $target_path/$file
-    do_md5sum ${outdir}02.$test
-    do_avconv_crc $file $DEC_OPTS $2 -i $target_path/$file
-    echo $(wc -c ${outdir}02.$test)
-}
-
 if [ -n "$do_avi" ] ; then
 do_lavf "" "-c:a mp2 -ar 44100"
 fi
@@ -107,60 +96,6 @@  do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $ENC_OPTS -t 1 -qsca
 do_avconv_crc $file -i $target_path/$file
 fi
 
-# image formats
-
-if [ -n "$do_pgm" ] ; then
-do_image_formats
-fi
-
-if [ -n "$do_ppm" ] ; then
-do_image_formats
-fi
-
-if [ -n "$do_png" ] ; then
-do_image_formats
-fi
-
-if [ -n "$do_bmp" ] ; then
-do_image_formats
-fi
-
-if [ -n "$do_tga" ] ; then
-do_image_formats
-fi
-
-if [ -n "$do_tiff" ] ; then
-do_image_formats "-pix_fmt rgb24"
-fi
-
-if [ -n "$do_sgi" ] ; then
-do_image_formats
-fi
-
-if [ -n "$do_jpg" ] ; then
-do_image_formats "-pix_fmt yuvj420p" "-f image2"
-fi
-
-if [ -n "$do_pam" ] ; then
-do_image_formats
-fi
-
-if [ -n "$do_pcx" ] ; then
-do_image_formats
-fi
-
-if [ -n "$do_xwd" ] ; then
-do_image_formats
-fi
-
-if [ -n "$do_dpx" ] ; then
-do_image_formats
-fi
-
-if [ -n "$do_sun" ] ; then
-do_image_formats
-fi
-
 # pix_fmt conversions
 
 if [ -n "$do_pixfmt" ] ; then
diff --git a/tests/ref/lavf/bmp b/tests/ref/lavf/bmp
index b79ee4d47c..20dd173ea5 100644
--- a/tests/ref/lavf/bmp
+++ b/tests/ref/lavf/bmp
@@ -1,3 +1,3 @@ 
-71f4d64a6b3c71f43a4eff526f84841c *./tests/data/images/bmp/02.bmp
-./tests/data/images/bmp/%02d.bmp CRC=0x3447369b
-304182 ./tests/data/images/bmp/02.bmp
+71f4d64a6b3c71f43a4eff526f84841c *tests/data/images/bmp/02.bmp
+tests/data/images/bmp/%02d.bmp CRC=0x3447369b
+304182 tests/data/images/bmp/02.bmp
diff --git a/tests/ref/lavf/dpx b/tests/ref/lavf/dpx
index 42c0a335fb..090a1cc058 100644
--- a/tests/ref/lavf/dpx
+++ b/tests/ref/lavf/dpx
@@ -1,3 +1,3 @@ 
-d2f0b4e854fda2d3b3bee84cef80593c *./tests/data/images/dpx/02.dpx
-./tests/data/images/dpx/%02d.dpx CRC=0x28c7369b
-305792 ./tests/data/images/dpx/02.dpx
+d2f0b4e854fda2d3b3bee84cef80593c *tests/data/images/dpx/02.dpx
+tests/data/images/dpx/%02d.dpx CRC=0x28c7369b
+305792 tests/data/images/dpx/02.dpx
diff --git a/tests/ref/lavf/jpg b/tests/ref/lavf/jpg
index 584a97a285..2b589965f3 100644
--- a/tests/ref/lavf/jpg
+++ b/tests/ref/lavf/jpg
@@ -1,3 +1,3 @@ 
-131878fee153a086d740543fbf2ab359 *./tests/data/images/jpg/02.jpg
-./tests/data/images/jpg/%02d.jpg CRC=0x9d770966
-28406 ./tests/data/images/jpg/02.jpg
+131878fee153a086d740543fbf2ab359 *tests/data/images/jpg/02.jpg
+tests/data/images/jpg/%02d.jpg CRC=0x9d770966
+28406 tests/data/images/jpg/02.jpg
diff --git a/tests/ref/lavf/pam b/tests/ref/lavf/pam
index 636a419a47..753c374a0c 100644
--- a/tests/ref/lavf/pam
+++ b/tests/ref/lavf/pam
@@ -1,3 +1,3 @@ 
-0dce5565222cf0f8b309467f279aecd2 *./tests/data/images/pam/02.pam
-./tests/data/images/pam/%02d.pam CRC=0x28c7369b
-304191 ./tests/data/images/pam/02.pam
+0dce5565222cf0f8b309467f279aecd2 *tests/data/images/pam/02.pam
+tests/data/images/pam/%02d.pam CRC=0x28c7369b
+304191 tests/data/images/pam/02.pam
diff --git a/tests/ref/lavf/pcx b/tests/ref/lavf/pcx
index e60ea782bc..4f43b1a428 100644
--- a/tests/ref/lavf/pcx
+++ b/tests/ref/lavf/pcx
@@ -1,3 +1,3 @@ 
-2df1d747fba23d03b6ff9c91b8b465c9 *./tests/data/images/pcx/02.pcx
-./tests/data/images/pcx/%02d.pcx CRC=0x28c7369b
-364147 ./tests/data/images/pcx/02.pcx
+2df1d747fba23d03b6ff9c91b8b465c9 *tests/data/images/pcx/02.pcx
+tests/data/images/pcx/%02d.pcx CRC=0x28c7369b
+364147 tests/data/images/pcx/02.pcx
diff --git a/tests/ref/lavf/pgm b/tests/ref/lavf/pgm
index 419fdaa46f..83c0a294e1 100644
--- a/tests/ref/lavf/pgm
+++ b/tests/ref/lavf/pgm
@@ -1,3 +1,3 @@ 
-388f5c51a678ca6a52cc006095c12f08 *./tests/data/images/pgm/02.pgm
-./tests/data/images/pgm/%02d.pgm CRC=0xa6866b82
-101391 ./tests/data/images/pgm/02.pgm
+388f5c51a678ca6a52cc006095c12f08 *tests/data/images/pgm/02.pgm
+tests/data/images/pgm/%02d.pgm CRC=0xa6866b82
+101391 tests/data/images/pgm/02.pgm
diff --git a/tests/ref/lavf/png b/tests/ref/lavf/png
index f216e7e904..6aa59eda16 100644
--- a/tests/ref/lavf/png
+++ b/tests/ref/lavf/png
@@ -1,3 +1,3 @@ 
-c162094e51dc1a3203de43e496086dfd *./tests/data/images/png/02.png
-./tests/data/images/png/%02d.png CRC=0x28c7369b
-248612 ./tests/data/images/png/02.png
+c162094e51dc1a3203de43e496086dfd *tests/data/images/png/02.png
+tests/data/images/png/%02d.png CRC=0x28c7369b
+248612 tests/data/images/png/02.png
diff --git a/tests/ref/lavf/ppm b/tests/ref/lavf/ppm
index 33275e2d36..6668b87cc0 100644
--- a/tests/ref/lavf/ppm
+++ b/tests/ref/lavf/ppm
@@ -1,3 +1,3 @@ 
-16d5dadf0b362fc8ba3cb676c5dde985 *./tests/data/images/ppm/02.ppm
-./tests/data/images/ppm/%02d.ppm CRC=0x28c7369b
-304143 ./tests/data/images/ppm/02.ppm
+16d5dadf0b362fc8ba3cb676c5dde985 *tests/data/images/ppm/02.ppm
+tests/data/images/ppm/%02d.ppm CRC=0x28c7369b
+304143 tests/data/images/ppm/02.ppm
diff --git a/tests/ref/lavf/sgi b/tests/ref/lavf/sgi
index 703b83cf66..b42a700357 100644
--- a/tests/ref/lavf/sgi
+++ b/tests/ref/lavf/sgi
@@ -1,3 +1,3 @@ 
-d446e540a7c18da5fd3cc0e9942cd46f *./tests/data/images/sgi/02.sgi
-./tests/data/images/sgi/%02d.sgi CRC=0x28c7369b
-307287 ./tests/data/images/sgi/02.sgi
+d446e540a7c18da5fd3cc0e9942cd46f *tests/data/images/sgi/02.sgi
+tests/data/images/sgi/%02d.sgi CRC=0x28c7369b
+307287 tests/data/images/sgi/02.sgi
diff --git a/tests/ref/lavf/sun b/tests/ref/lavf/sun
index 097235b75c..ffcda04b61 100644
--- a/tests/ref/lavf/sun
+++ b/tests/ref/lavf/sun
@@ -1,3 +1,3 @@ 
-07518bcb0841bc677ce6aea8464ea240 *./tests/data/images/sun/02.sun
-./tests/data/images/sun/%02d.sun CRC=0x3447369b
-304123 ./tests/data/images/sun/02.sun
+07518bcb0841bc677ce6aea8464ea240 *tests/data/images/sun/02.sun
+tests/data/images/sun/%02d.sun CRC=0x3447369b
+304123 tests/data/images/sun/02.sun
diff --git a/tests/ref/lavf/tga b/tests/ref/lavf/tga
index ce6b6466bb..ac1097edb6 100644
--- a/tests/ref/lavf/tga
+++ b/tests/ref/lavf/tga
@@ -1,3 +1,3 @@ 
-c0305c53e6d79d4ed9f35f04f671246c *./tests/data/images/tga/02.tga
-./tests/data/images/tga/%02d.tga CRC=0x3447369b
-304172 ./tests/data/images/tga/02.tga
+c0305c53e6d79d4ed9f35f04f671246c *tests/data/images/tga/02.tga
+tests/data/images/tga/%02d.tga CRC=0x3447369b
+304172 tests/data/images/tga/02.tga
diff --git a/tests/ref/lavf/tiff b/tests/ref/lavf/tiff
index b636bd9c8b..f75840fa79 100644
--- a/tests/ref/lavf/tiff
+++ b/tests/ref/lavf/tiff
@@ -1,3 +1,3 @@ 
-b3299346a8959553a437e486d8f3bf76 *./tests/data/images/tiff/02.tiff
-./tests/data/images/tiff/%02d.tiff CRC=0x28c7369b
-307131 ./tests/data/images/tiff/02.tiff
+b3299346a8959553a437e486d8f3bf76 *tests/data/images/tiff/02.tiff
+tests/data/images/tiff/%02d.tiff CRC=0x28c7369b
+307131 tests/data/images/tiff/02.tiff
diff --git a/tests/ref/lavf/xwd b/tests/ref/lavf/xwd
index 3fd20c8f6c..ad7f9867c9 100644
--- a/tests/ref/lavf/xwd
+++ b/tests/ref/lavf/xwd
@@ -1,3 +1,3 @@ 
-50baa5560b7d1aa3188b19c1162bf7dc *./tests/data/images/xwd/02.xwd
-./tests/data/images/xwd/%02d.xwd CRC=0x28c7369b
-304239 ./tests/data/images/xwd/02.xwd
+50baa5560b7d1aa3188b19c1162bf7dc *tests/data/images/xwd/02.xwd
+tests/data/images/xwd/%02d.xwd CRC=0x28c7369b
+304239 tests/data/images/xwd/02.xwd