From a957e9379d11f2982d615f92c30580a57ea8bb40 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sat, 2 Feb 2019 13:54:47 +0100 Subject: tests: Convert lavf image tests to non-legacy test scripts Rename some tests in the process for consistency and simplicity. --- tests/Makefile | 1 + tests/fate-run.sh | 11 ++++++++ tests/fate/avformat.mak | 13 ---------- tests/fate/lavf-image.mak | 25 ++++++++++++++++++ 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 | 3 +++ tests/ref/lavf/sunrast | 3 --- tests/ref/lavf/tga | 6 ++--- tests/ref/lavf/tiff | 6 ++--- tests/ref/lavf/xwd | 6 ++--- 19 files changed, 76 insertions(+), 117 deletions(-) create mode 100644 tests/fate/lavf-image.mak create mode 100644 tests/ref/lavf/sun delete mode 100644 tests/ref/lavf/sunrast (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile index 6ad54eba71..ce7b58bd8b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -62,6 +62,7 @@ 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-image.mak include $(SRC_PATH)/tests/fate/lavf-image2pipe.mak include $(SRC_PATH)/tests/fate/seek.mak diff --git a/tests/fate-run.sh b/tests/fate-run.sh index b20e013d6b..a9dfebc364 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -197,6 +197,17 @@ lavf_audio(){ do_avconv_crc $file $DEC_OPTS $3 -i $target_path/$file } +lavf_image(){ + 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) +} + lavf_image2pipe(){ t="${test#lavf-}" t="${t%pipe}" diff --git a/tests/fate/avformat.mak b/tests/fate/avformat.mak index d840227914..9dbdff71ef 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_fmt FATE_LAVF-$(call ENCDEC, FLV, FLV) += flv_fmt 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) += sunrast 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) += yuv4mpeg FATE_LAVF += $(FATE_LAVF-yes:%=fate-lavf-%) diff --git a/tests/fate/lavf-image.mak b/tests/fate/lavf-image.mak new file mode 100644 index 0000000000..24acdb70f0 --- /dev/null +++ b/tests/fate/lavf-image.mak @@ -0,0 +1,25 @@ +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 = lavf_image +$(FATE_LAVF_IMAGES): REF = $(SRC_PATH)/tests/ref/lavf/$(@:fate-lavf-%=%) +$(FATE_LAVF_IMAGES): $(VREF) + +fate-lavf-jpg: CMD = lavf_image "-pix_fmt yuvj420p" "-f image2" +fate-lavf-tiff: CMD = lavf_image "-pix_fmt rgb24" + +FATE_AVCONV += $(FATE_LAVF_IMAGES) +fate-lavf-images fate-lavf: $(FATE_LAVF_IMAGES) diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh index 65d28fb29b..493083bf63 100755 --- a/tests/lavf-regression.sh +++ b/tests/lavf-regression.sh @@ -19,17 +19,6 @@ do_lavf() do_avconv_crc $file $DEC_OPTS -i $target_path/$file $4 } -do_image_formats() -{ - outfile="$datadir/images/$1/" - mkdir -p "$outfile" - file=${outfile}%02d.$1 - run_avconv $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $2 $ENC_OPTS $3 -frames 12 -y -qscale 10 $target_path/$file - do_md5sum ${outfile}02.$1 - do_avconv_crc $file $DEC_OPTS $3 -i $target_path/$file - echo $(wc -c ${outfile}02.$1) -} - if [ -n "$do_avi" ] ; then do_lavf avi "" "-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 pgm -fi - -if [ -n "$do_ppm" ] ; then -do_image_formats ppm -fi - -if [ -n "$do_png" ] ; then -do_image_formats png -fi - -if [ -n "$do_bmp" ] ; then -do_image_formats bmp -fi - -if [ -n "$do_tga" ] ; then -do_image_formats tga -fi - -if [ -n "$do_tiff" ] ; then -do_image_formats tiff "-pix_fmt rgb24" -fi - -if [ -n "$do_sgi" ] ; then -do_image_formats sgi -fi - -if [ -n "$do_jpg" ] ; then -do_image_formats jpg "-pix_fmt yuvj420p" "-f image2" -fi - -if [ -n "$do_pam" ] ; then -do_image_formats pam -fi - -if [ -n "$do_pcx" ] ; then -do_image_formats pcx -fi - -if [ -n "$do_xwd" ] ; then -do_image_formats xwd -fi - -if [ -n "$do_dpx" ] ; then -do_image_formats dpx -fi - -if [ -n "$do_sunrast" ] ; then -do_image_formats sun -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 new file mode 100644 index 0000000000..ffcda04b61 --- /dev/null +++ b/tests/ref/lavf/sun @@ -0,0 +1,3 @@ +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/sunrast b/tests/ref/lavf/sunrast deleted file mode 100644 index 097235b75c..0000000000 --- a/tests/ref/lavf/sunrast +++ /dev/null @@ -1,3 +0,0 @@ -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 -- cgit v1.2.3