tests: Convert audio-only lavf tests to non-legacy test scripts
authorDiego Biurrun <diego@biurrun.de>
Sat, 2 Feb 2019 12:49:53 +0000 (13:49 +0100)
committerDiego Biurrun <diego@biurrun.de>
Sat, 16 Feb 2019 17:15:22 +0000 (18:15 +0100)
Rename some tests in the process for consistency and simplicity.

22 files changed:
tests/Makefile
tests/fate-run.sh
tests/fate/avformat.mak
tests/fate/lavf-audio.mak [new file with mode: 0644]
tests/fate/seek.mak
tests/lavf-regression.sh
tests/ref/lavf/aiff
tests/ref/lavf/al [new file with mode: 0644]
tests/ref/lavf/alaw [deleted file]
tests/ref/lavf/au
tests/ref/lavf/mmf
tests/ref/lavf/mulaw [deleted file]
tests/ref/lavf/ogg
tests/ref/lavf/rso
tests/ref/lavf/s16.voc [new file with mode: 0644]
tests/ref/lavf/sox
tests/ref/lavf/ul [new file with mode: 0644]
tests/ref/lavf/voc
tests/ref/lavf/voc_s16 [deleted file]
tests/ref/lavf/wav
tests/ref/seek/lavf-al [moved from tests/ref/seek/lavf-mulaw with 100% similarity]
tests/ref/seek/lavf-ul [moved from tests/ref/seek/lavf-alaw with 100% similarity]

index 1884f5e..6ad54eb 100644 (file)
@@ -61,6 +61,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-audio.mak
 include $(SRC_PATH)/tests/fate/lavf-image2pipe.mak
 include $(SRC_PATH)/tests/fate/seek.mak
 
index 0221e5c..b20e013 100755 (executable)
@@ -156,6 +156,7 @@ enc_dec(){
 # functions above and below that should be refactored.
 avconv2="$target_exec ${target_path}/avconv"
 raw_src="${target_path}/tests/vsynth1/%02d.pgm"
+pcm_src="${target_path}/tests/data/asynth1.sw"
 crcfile="tests/data/$test.lavf.crc"
 target_crcfile="${target_path}/$crcfile"
 
@@ -188,6 +189,14 @@ do_avconv_crc(){
     echo "$f $(cat $crcfile)"
 }
 
+lavf_audio(){
+    t="${test#lavf-}"
+    outdir="tests/data/lavf"
+    file=${outdir}/lavf.$t
+    do_avconv $file $DEC_OPTS $1 -ar 44100 -f s16le -i $pcm_src $ENC_OPTS -t 1 -qscale 10 $2
+    do_avconv_crc $file $DEC_OPTS $3 -i $target_path/$file
+}
+
 lavf_image2pipe(){
     t="${test#lavf-}"
     t="${t%pipe}"
index a4a0988..d840227 100644 (file)
@@ -1,7 +1,4 @@
-FATE_LAVF-$(call ENCDEC,  PCM_S16BE,             AIFF)               += aiff
-FATE_LAVF-$(call ENCDEC,  PCM_ALAW,              PCM_ALAW)           += alaw
 FATE_LAVF-$(call ENCDEC2, MSMPEG4V3,  MP2,       ASF)                += asf
-FATE_LAVF-$(call ENCDEC,  PCM_S16BE,             AU)                 += au
 FATE_LAVF-$(call ENCDEC2, MPEG4,      MP2,       AVI)                += avi
 FATE_LAVF-$(call ENCDEC,  BMP,                   IMAGE2)             += bmp
 FATE_LAVF-$(call ENCDEC,  DPX,                   IMAGE2)             += dpx
@@ -11,31 +8,23 @@ 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 ENCDEC,  ADPCM_YAMAHA,          MMF)                += mmf
 FATE_LAVF-$(call ENCDEC2, MPEG4,      PCM_ALAW,  MOV)                += mov
 FATE_LAVF-$(call ENCDEC2, MPEG1VIDEO, MP2,       MPEG1SYSTEM MPEGPS) += mpg
-FATE_LAVF-$(call ENCDEC,  PCM_MULAW,             PCM_MULAW)          += mulaw
 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,  FLAC,                  OGG)                += ogg
 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,  PCM_U8,                RSO)                += rso
 FATE_LAVF-$(call ENCDEC,  SGI,                   IMAGE2)             += sgi
-FATE_LAVF-$(call ENCDEC,  PCM_S16LE,             SOX)                += sox
 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,  PCM_U8,                VOC)                += voc
-FATE_LAVF-$(call ENCDEC,  PCM_S16LE,             VOC)                += voc_s16
-FATE_LAVF-$(call ENCDEC,  PCM_S16LE,             WAV)                += wav
 FATE_LAVF-$(call ENCDEC,  XWD,                   IMAGE2)             += xwd
 FATE_LAVF-$(CONFIG_YUV4MPEGPIPE_MUXER)                               += yuv4mpeg
 
diff --git a/tests/fate/lavf-audio.mak b/tests/fate/lavf-audio.mak
new file mode 100644 (file)
index 0000000..13440e4
--- /dev/null
@@ -0,0 +1,24 @@
+FATE_LAVF_AUDIO-$(call ENCDEC,  PCM_S16BE,    AIFF)             += aiff
+FATE_LAVF_AUDIO-$(call ENCDEC,  PCM_ALAW,     PCM_ALAW)         += al
+FATE_LAVF_AUDIO-$(call ENCDEC,  PCM_S16BE,    AU)               += au
+FATE_LAVF_AUDIO-$(call ENCDEC,  ADPCM_YAMAHA, MMF)              += mmf
+FATE_LAVF_AUDIO-$(call ENCDEC,  FLAC,         OGG)              += ogg
+FATE_LAVF_AUDIO-$(call ENCDEC,  PCM_U8,       RSO)              += rso
+FATE_LAVF_AUDIO-$(call ENCDEC,  PCM_S16LE,    SOX)              += sox
+FATE_LAVF_AUDIO-$(call ENCDEC,  PCM_MULAW,    PCM_MULAW)        += ul
+FATE_LAVF_AUDIO-$(call ENCDEC,  PCM_U8,       VOC)              += voc
+FATE_LAVF_AUDIO-$(call ENCDEC,  PCM_S16LE,    VOC)              += s16.voc
+FATE_LAVF_AUDIO-$(call ENCDEC,  PCM_S16LE,    WAV)              += wav
+
+FATE_LAVF_AUDIO = $(FATE_LAVF_AUDIO-yes:%=fate-lavf-%)
+
+$(FATE_LAVF_AUDIO): CMD = lavf_audio
+$(FATE_LAVF_AUDIO): REF = $(SRC_PATH)/tests/ref/lavf/$(@:fate-lavf-%=%)
+$(FATE_LAVF_AUDIO): $(AREF)
+
+fate-lavf-al fate-lavf-ul: CMD = lavf_audio "" "" "-ar 44100"
+fate-lavf-ogg: CMD = lavf_audio "" "-c:a flac"
+fate-lavf-s16.voc: CMD = lavf_audio "-ac 2" "-c:a pcm_s16le"
+
+FATE_AVCONV += $(FATE_LAVF_AUDIO)
+fate-lavf-audio fate-lavf: $(FATE_LAVF_AUDIO)
index 60adab2..e232d6a 100644 (file)
@@ -145,7 +145,7 @@ FATE_SEEK += $(FATE_SEEK_VSYNTH2-yes:%=fate-seek-vsynth2-%)
 # files from fate-lavf
 
 FATE_SEEK_LAVF-$(call ENCDEC,  PCM_S16BE,             AIFF)        += aiff
-FATE_SEEK_LAVF-$(call ENCDEC,  PCM_ALAW,              PCM_ALAW)    += alaw
+FATE_SEEK_LAVF-$(call ENCDEC,  PCM_ALAW,              PCM_ALAW)    += al
 FATE_SEEK_LAVF-$(call ENCDEC2, MSMPEG4V3,  MP2,       ASF)         += asf
 FATE_SEEK_LAVF-$(call ENCDEC,  PCM_S16BE,             AU)          += au
 FATE_SEEK_LAVF-$(call ENCDEC2, MPEG4,      MP2,       AVI)         += avi
@@ -159,7 +159,7 @@ FATE_SEEK_LAVF-$(call ENCDEC2, MPEG4,      MP2,       MATROSKA)    += mkv
 FATE_SEEK_LAVF-$(call ENCDEC,  ADPCM_YAMAHA,          MMF)         += mmf
 FATE_SEEK_LAVF-$(call ENCDEC2, MPEG4,      PCM_ALAW,  MOV)         += mov
 FATE_SEEK_LAVF-$(call ENCDEC2, MPEG1VIDEO, MP2,       MPEG1SYSTEM MPEGPS) += mpg
-FATE_SEEK_LAVF-$(call ENCDEC,  PCM_MULAW,             PCM_MULAW)   += mulaw
+FATE_SEEK_LAVF-$(call ENCDEC,  PCM_MULAW,             PCM_MULAW)   += ul
 FATE_SEEK_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF)         += mxf
 FATE_SEEK_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF_D10 MXF) += mxf_d10
 FATE_SEEK_LAVF-$(call ENCDEC2, MPEG4,      MP2,       NUT)         += nut
@@ -180,8 +180,8 @@ 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-aiff:     SRC = lavf/lavf.aif
-fate-seek-lavf-alaw:     SRC = lavf/lavf.al
+fate-seek-lavf-aiff:     SRC = lavf/lavf.aiff
+fate-seek-lavf-al:       SRC = lavf/lavf.al
 fate-seek-lavf-asf:      SRC = lavf/lavf.asf
 fate-seek-lavf-au:       SRC = lavf/lavf.au
 fate-seek-lavf-avi:      SRC = lavf/lavf.avi
@@ -195,7 +195,7 @@ fate-seek-lavf-mkv:      SRC = lavf/lavf.mkv
 fate-seek-lavf-mmf:      SRC = lavf/lavf.mmf
 fate-seek-lavf-mov:      SRC = lavf/lavf.mov
 fate-seek-lavf-mpg:      SRC = lavf/lavf.mpg
-fate-seek-lavf-mulaw:    SRC = lavf/lavf.ul
+fate-seek-lavf-ul:       SRC = lavf/lavf.ul
 fate-seek-lavf-mxf:      SRC = lavf/lavf.mxf
 fate-seek-lavf-mxf_d10:  SRC = lavf/lavf.mxf_d10
 fate-seek-lavf-nut:      SRC = lavf/lavf.nut
index fecc36c..65d28fb 100755 (executable)
@@ -30,13 +30,6 @@ do_image_formats()
     echo $(wc -c ${outfile}02.$1)
 }
 
-do_audio_only()
-{
-    file=${outfile}lavf.$1
-    do_avconv $file $DEC_OPTS $2 -ar 44100 -f s16le -i $pcm_src $ENC_OPTS -t 1 -qscale 10 $3
-    do_avconv_crc $file $DEC_OPTS $4 -i $target_path/$file
-}
-
 if [ -n "$do_avi" ] ; then
 do_lavf avi "" "-c:a mp2 -ar 44100"
 fi
@@ -168,52 +161,6 @@ if [ -n "$do_sunrast" ] ; then
 do_image_formats sun
 fi
 
-# audio only
-
-if [ -n "$do_wav" ] ; then
-do_audio_only wav
-fi
-
-if [ -n "$do_alaw" ] ; then
-do_audio_only al "" "" "-ar 44100"
-fi
-
-if [ -n "$do_mulaw" ] ; then
-do_audio_only ul "" "" "-ar 44100"
-fi
-
-if [ -n "$do_au" ] ; then
-do_audio_only au
-fi
-
-if [ -n "$do_mmf" ] ; then
-do_audio_only mmf
-fi
-
-if [ -n "$do_aiff" ] ; then
-do_audio_only aif
-fi
-
-if [ -n "$do_voc" ] ; then
-do_audio_only voc
-fi
-
-if [ -n "$do_voc_s16" ] ; then
-do_audio_only s16.voc "-ac 2" "-c:a pcm_s16le"
-fi
-
-if [ -n "$do_ogg" ] ; then
-do_audio_only ogg "" "-c:a flac"
-fi
-
-if [ -n "$do_rso" ] ; then
-do_audio_only rso
-fi
-
-if [ -n "$do_sox" ] ; then
-do_audio_only sox
-fi
-
 # pix_fmt conversions
 
 if [ -n "$do_pixfmt" ] ; then
index c713d02..479f7d7 100644 (file)
@@ -1,3 +1,3 @@
-9d9e55431800bf6aea46a7d67509da4e *./tests/data/lavf/lavf.aif
-88254 ./tests/data/lavf/lavf.aif
-./tests/data/lavf/lavf.aif CRC=0x3a1da17e
+9d9e55431800bf6aea46a7d67509da4e *tests/data/lavf/lavf.aiff
+88254 tests/data/lavf/lavf.aiff
+tests/data/lavf/lavf.aiff CRC=0x3a1da17e
diff --git a/tests/ref/lavf/al b/tests/ref/lavf/al
new file mode 100644 (file)
index 0000000..c383c36
--- /dev/null
@@ -0,0 +1,3 @@
+652d96e474869ddb01403743deb35117 *tests/data/lavf/lavf.al
+44100 tests/data/lavf/lavf.al
+tests/data/lavf/lavf.al CRC=0xf9643112
diff --git a/tests/ref/lavf/alaw b/tests/ref/lavf/alaw
deleted file mode 100644 (file)
index d93d6fc..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-652d96e474869ddb01403743deb35117 *./tests/data/lavf/lavf.al
-44100 ./tests/data/lavf/lavf.al
-./tests/data/lavf/lavf.al CRC=0xf9643112
index 71cfdcb..49ddd31 100644 (file)
@@ -1,3 +1,3 @@
-b9396e3775ea009094e751e7128d614e *./tests/data/lavf/lavf.au
-88224 ./tests/data/lavf/lavf.au
-./tests/data/lavf/lavf.au CRC=0x3a1da17e
+b9396e3775ea009094e751e7128d614e *tests/data/lavf/lavf.au
+88224 tests/data/lavf/lavf.au
+tests/data/lavf/lavf.au CRC=0x3a1da17e
index 947abc7..fd308a4 100644 (file)
@@ -1,3 +1,3 @@
-1a3bbf19a41668c1e928bcafce88ff3e *./tests/data/lavf/lavf.mmf
-22617 ./tests/data/lavf/lavf.mmf
-./tests/data/lavf/lavf.mmf CRC=0x8dea1388
+1a3bbf19a41668c1e928bcafce88ff3e *tests/data/lavf/lavf.mmf
+22617 tests/data/lavf/lavf.mmf
+tests/data/lavf/lavf.mmf CRC=0x8dea1388
diff --git a/tests/ref/lavf/mulaw b/tests/ref/lavf/mulaw
deleted file mode 100644 (file)
index bd54084..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-ad492935e361f830f2f8302aa102701d *./tests/data/lavf/lavf.ul
-44100 ./tests/data/lavf/lavf.ul
-./tests/data/lavf/lavf.ul CRC=0x4515fa26
index ea827ac..5372402 100644 (file)
@@ -1,3 +1,3 @@
-8ca901bc8d24b80ebe79e387e454d1e9 *./tests/data/lavf/lavf.ogg
-13476 ./tests/data/lavf/lavf.ogg
-./tests/data/lavf/lavf.ogg CRC=0x3a1da17e
+8ca901bc8d24b80ebe79e387e454d1e9 *tests/data/lavf/lavf.ogg
+13476 tests/data/lavf/lavf.ogg
+tests/data/lavf/lavf.ogg CRC=0x3a1da17e
index 5878f43..6b2f03e 100644 (file)
@@ -1,3 +1,3 @@
-443b72346065d6318ca18c8395aa1d87 *./tests/data/lavf/lavf.rso
-44108 ./tests/data/lavf/lavf.rso
-./tests/data/lavf/lavf.rso CRC=0x298fd284
+443b72346065d6318ca18c8395aa1d87 *tests/data/lavf/lavf.rso
+44108 tests/data/lavf/lavf.rso
+tests/data/lavf/lavf.rso CRC=0x298fd284
diff --git a/tests/ref/lavf/s16.voc b/tests/ref/lavf/s16.voc
new file mode 100644 (file)
index 0000000..6cd6ba9
--- /dev/null
@@ -0,0 +1,3 @@
+e55a9c632cfeab90bcfb9ff29a71728c *tests/data/lavf/lavf.s16.voc
+176613 tests/data/lavf/lavf.s16.voc
+tests/data/lavf/lavf.s16.voc CRC=0xe61e3bd0
index fc368b1..fc3953e 100644 (file)
@@ -1,3 +1,3 @@
-683635d5cb1344e44fa96df90c3a993c *./tests/data/lavf/lavf.sox
-176432 ./tests/data/lavf/lavf.sox
-./tests/data/lavf/lavf.sox CRC=0x3a1da17e
+683635d5cb1344e44fa96df90c3a993c *tests/data/lavf/lavf.sox
+176432 tests/data/lavf/lavf.sox
+tests/data/lavf/lavf.sox CRC=0x3a1da17e
diff --git a/tests/ref/lavf/ul b/tests/ref/lavf/ul
new file mode 100644 (file)
index 0000000..cf02593
--- /dev/null
@@ -0,0 +1,3 @@
+ad492935e361f830f2f8302aa102701d *tests/data/lavf/lavf.ul
+44100 tests/data/lavf/lavf.ul
+tests/data/lavf/lavf.ul CRC=0x4515fa26
index 3131960..2d1fbc7 100644 (file)
@@ -1,3 +1,3 @@
-ae01db5200e569371d4c27316575344c *./tests/data/lavf/lavf.voc
-44305 ./tests/data/lavf/lavf.voc
-./tests/data/lavf/lavf.voc CRC=0x298fd284
+ae01db5200e569371d4c27316575344c *tests/data/lavf/lavf.voc
+44305 tests/data/lavf/lavf.voc
+tests/data/lavf/lavf.voc CRC=0x298fd284
diff --git a/tests/ref/lavf/voc_s16 b/tests/ref/lavf/voc_s16
deleted file mode 100644 (file)
index deb7999..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-e55a9c632cfeab90bcfb9ff29a71728c *./tests/data/lavf/lavf.s16.voc
-176613 ./tests/data/lavf/lavf.s16.voc
-./tests/data/lavf/lavf.s16.voc CRC=0xe61e3bd0
index fa8a859..e34535e 100644 (file)
@@ -1,3 +1,3 @@
-41410d9bbe0603740d1c17050746f475 *./tests/data/lavf/lavf.wav
-88246 ./tests/data/lavf/lavf.wav
-./tests/data/lavf/lavf.wav CRC=0x3a1da17e
+41410d9bbe0603740d1c17050746f475 *tests/data/lavf/lavf.wav
+88246 tests/data/lavf/lavf.wav
+tests/data/lavf/lavf.wav CRC=0x3a1da17e