diff options
author | James Almer <jamrial@gmail.com> | 2019-03-14 20:04:55 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-03-14 20:15:46 +0300 |
commit | d0c43e32427ec1efac364be0987a6aafa695527f (patch) | |
tree | b1c66b7aff6cce563836422f329bccc770e08933 /tests | |
parent | a8c5ae451184e879fc8ff1333c6f26f9542c8ebf (diff) | |
parent | a70eac7a9b193e8434b5bed90bd72aa4cb688363 (diff) |
Merge commit 'a70eac7a9b193e8434b5bed90bd72aa4cb688363'
* commit 'a70eac7a9b193e8434b5bed90bd72aa4cb688363':
tests: Convert image2pipe tests to non-legacy test scripts
Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile | 1 | ||||
-rwxr-xr-x | tests/fate-run.sh | 47 | ||||
-rw-r--r-- | tests/fate/avformat.mak | 3 | ||||
-rw-r--r-- | tests/fate/lavf-image2pipe.mak | 12 | ||||
-rwxr-xr-x | tests/lavf-regression.sh | 19 | ||||
-rw-r--r-- | tests/ref/lavf/pbmpipe | 6 | ||||
-rw-r--r-- | tests/ref/lavf/pgmpipe | 6 | ||||
-rw-r--r-- | tests/ref/lavf/ppmpipe | 6 |
8 files changed, 69 insertions, 31 deletions
diff --git a/tests/Makefile b/tests/Makefile index ae658693db..0def7e0dae 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -90,6 +90,7 @@ 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-image2pipe.mak include $(SRC_PATH)/tests/fate/seek.mak include $(SRC_PATH)/tests/fate/aac.mak diff --git a/tests/fate-run.sh b/tests/fate-run.sh index f1a1e34c36..2d5dbf2f47 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -243,6 +243,53 @@ stream_remux(){ -f framecrc - || return } +# FIXME: There is a certain duplication between the avconv-related helper +# functions above and below that should be refactored. +ffmpeg2="$target_exec ${target_path}/ffmpeg" +raw_src="${target_path}/tests/vsynth1/%02d.pgm" +crcfile="tests/data/$test.lavf.crc" +target_crcfile="${target_path}/$crcfile" + +[ "${V-0}" -gt 0 ] && echov=echov || echov=: + +echov(){ + echo "$@" >&3 +} + +AVCONV_OPTS="-nostdin -nostats -y -cpuflags $cpuflags -threads $threads" +DEC_OPTS="-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact" +ENC_OPTS="$DEC_OPTS -threads $threads -dct fastint" + +run_avconv(){ + $echov $ffmpeg2 $AVCONV_OPTS $* + $ffmpeg2 $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)" +} + +lavf_image2pipe(){ + t="${test#lavf-}" + t="${t%pipe}" + outdir="tests/data/lavf" + file=${outdir}/${t}pipe.$t + do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src -f image2pipe "$ENC_OPTS -metadata title=lavftest" -t 1 -qscale 10 + do_avconv_crc $file $DEC_OPTS -f image2pipe -i $target_path/$file +} + lavffatetest(){ t="${test#lavf-fate-}" ref=${base}/ref/lavf-fate/$t diff --git a/tests/fate/avformat.mak b/tests/fate/avformat.mak index a12f9ccc71..a0eaeefbe0 100644 --- a/tests/fate/avformat.mak +++ b/tests/fate/avformat.mak @@ -31,13 +31,10 @@ FATE_LAVF-$(call ENCDEC2, DNXHD, PCM_S16LE, MXF_OPATOM MXF) += mxf_opat FATE_LAVF-$(call ENCDEC2, MPEG4, MP2, NUT) += nut FATE_LAVF-$(call ENCDEC, FLAC, OGG) += ogg FATE_LAVF-$(call ENCDEC, PAM, IMAGE2) += pam -FATE_LAVF-$(call ENCDEC, PBM, IMAGE2PIPE) += pbmpipe FATE_LAVF-$(call ENCDEC, PCX, IMAGE2) += pcx FATE_LAVF-$(call ENCDEC, PGM, IMAGE2) += pgm -FATE_LAVF-$(call ENCDEC, PGM, IMAGE2PIPE) += pgmpipe FATE_LAVF-$(call ENCDEC, PNG, IMAGE2) += png FATE_LAVF-$(call ENCDEC, PPM, IMAGE2) += ppm -FATE_LAVF-$(call ENCDEC, PPM, IMAGE2PIPE) += ppmpipe FATE_LAVF-$(call ENCMUX, RV10 AC3_FIXED, RM) += rm FATE_LAVF-$(call ENCDEC, PCM_U8, RSO) += rso FATE_LAVF-$(call ENCDEC, SGI, IMAGE2) += sgi diff --git a/tests/fate/lavf-image2pipe.mak b/tests/fate/lavf-image2pipe.mak new file mode 100644 index 0000000000..297f677ada --- /dev/null +++ b/tests/fate/lavf-image2pipe.mak @@ -0,0 +1,12 @@ +FATE_LAVF_IMAGE2PIPE-$(call ENCDEC, PBM, IMAGE2PIPE) += pbmpipe +FATE_LAVF_IMAGE2PIPE-$(call ENCDEC, PGM, IMAGE2PIPE) += pgmpipe +FATE_LAVF_IMAGE2PIPE-$(call ENCDEC, PPM, IMAGE2PIPE) += ppmpipe + +FATE_LAVF_IMAGE2PIPE = $(FATE_LAVF_IMAGE2PIPE-yes:%=fate-lavf-%) + +$(FATE_LAVF_IMAGE2PIPE): CMD = lavf_image2pipe +$(FATE_LAVF_IMAGE2PIPE): REF = $(SRC_PATH)/tests/ref/lavf/$(@:fate-lavf-%=%) +$(FATE_LAVF_IMAGE2PIPE): $(VREF) + +FATE_AVCONV += $(FATE_LAVF_IMAGE2PIPE) +fate-lavf-image2pipe fate-lavf: $(FATE_LAVF_IMAGE2PIPE) diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh index c5b6734815..baf2dc76a5 100755 --- a/tests/lavf-regression.sh +++ b/tests/lavf-regression.sh @@ -39,13 +39,6 @@ do_lavf_timecode() do_lavf $1 "" "$2" } -do_streamed_images() -{ - file=${outfile}${1}pipe.$1 - do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe $ENC_OPTS -t 1 -qscale 10 - do_avconv_crc $file $DEC_OPTS -f image2pipe -i $target_path/$file -} - do_image_formats() { outfile="$datadir/images/$1/" @@ -202,18 +195,6 @@ fi #do_avconv $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src #do_avconv_crc $file -i $target_path/$file -if [ -n "$do_pbmpipe" ] ; then -do_streamed_images pbm -fi - -if [ -n "$do_pgmpipe" ] ; then -do_streamed_images pgm -fi - -if [ -n "$do_ppmpipe" ] ; then -do_streamed_images ppm -fi - if [ -n "$do_gif" ] ; then file=${outfile}lavf.gif do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24 diff --git a/tests/ref/lavf/pbmpipe b/tests/ref/lavf/pbmpipe index 284f90b16b..5cfb9b5e77 100644 --- a/tests/ref/lavf/pbmpipe +++ b/tests/ref/lavf/pbmpipe @@ -1,3 +1,3 @@ -8b974da7f48f9e6d5ae327b4444a71fb *./tests/data/lavf/pbmpipe.pbm -317075 ./tests/data/lavf/pbmpipe.pbm -./tests/data/lavf/pbmpipe.pbm CRC=0xfc010c66 +8b974da7f48f9e6d5ae327b4444a71fb *tests/data/lavf/pbmpipe.pbm +317075 tests/data/lavf/pbmpipe.pbm +tests/data/lavf/pbmpipe.pbm CRC=0xfc010c66 diff --git a/tests/ref/lavf/pgmpipe b/tests/ref/lavf/pgmpipe index da6f9a6d3a..1077a9514a 100644 --- a/tests/ref/lavf/pgmpipe +++ b/tests/ref/lavf/pgmpipe @@ -1,3 +1,3 @@ -c34e37ea49237c2d1ea81a5944328e59 *./tests/data/lavf/pgmpipe.pgm -2534775 ./tests/data/lavf/pgmpipe.pgm -./tests/data/lavf/pgmpipe.pgm CRC=0x7aa0122f +c34e37ea49237c2d1ea81a5944328e59 *tests/data/lavf/pgmpipe.pgm +2534775 tests/data/lavf/pgmpipe.pgm +tests/data/lavf/pgmpipe.pgm CRC=0x7aa0122f diff --git a/tests/ref/lavf/ppmpipe b/tests/ref/lavf/ppmpipe index b703e16e50..a50dbb0671 100644 --- a/tests/ref/lavf/ppmpipe +++ b/tests/ref/lavf/ppmpipe @@ -1,3 +1,3 @@ -74f1f6651ad8f192a7b4c11c2b6c71e5 *./tests/data/lavf/ppmpipe.ppm -7603575 ./tests/data/lavf/ppmpipe.ppm -./tests/data/lavf/ppmpipe.ppm CRC=0x87b3c15f +74f1f6651ad8f192a7b4c11c2b6c71e5 *tests/data/lavf/ppmpipe.ppm +7603575 tests/data/lavf/ppmpipe.ppm +tests/data/lavf/ppmpipe.ppm CRC=0x87b3c15f |