[12/20] tests: Move do_audio_only() to fate-run.sh

Message ID 20180920084729.4523-13-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        |  8 ++++++++
 tests/fate/avformat.mak  | 37 +++++++++++++++++++++------------
 tests/lavf-regression.sh | 53 ------------------------------------------------
 tests/ref/lavf/aiff      |  6 +++---
 tests/ref/lavf/al        |  6 +++---
 tests/ref/lavf/au        |  6 +++---
 tests/ref/lavf/mmf       |  6 +++---
 tests/ref/lavf/ogg       |  6 +++---
 tests/ref/lavf/rso       |  6 +++---
 tests/ref/lavf/sox       |  6 +++---
 tests/ref/lavf/ul        |  6 +++---
 tests/ref/lavf/voc       |  6 +++---
 tests/ref/lavf/voc_s16   |  6 +++---
 tests/ref/lavf/wav       |  6 +++---
 14 files changed, 65 insertions(+), 99 deletions(-)

Patch

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 603860b81d..63fc9662b7 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -155,6 +155,7 @@  enc_dec(){
 # various files
 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"
 
@@ -187,6 +188,13 @@  do_avconv_crc(){
     echo "$f $(cat $crcfile)"
 }
 
+audio_only(){
+    t="${test#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
+}
+
 streamed_images(){
     t="${test#lavf-}"
     t="${t%pipe}"
diff --git a/tests/fate/avformat.mak b/tests/fate/avformat.mak
index 51a9e2acaf..e677a21df5 100644
--- a/tests/fate/avformat.mak
+++ b/tests/fate/avformat.mak
@@ -1,7 +1,4 @@ 
-FATE_LAVF-$(call ENCDEC,  PCM_S16BE,             AIFF)               += aiff
-FATE_LAVF-$(call ENCDEC,  PCM_ALAW,              PCM_ALAW)           += al
 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,34 +8,48 @@  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)          += ul
 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)             += 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,  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)                               += y4m
 
+FATE_LAVF_AUDIO_ONLY-$(call ENCDEC,  PCM_S16BE,    AIFF)             += aiff
+FATE_LAVF_AUDIO_ONLY-$(call ENCDEC,  PCM_ALAW,     PCM_ALAW)         += al
+FATE_LAVF_AUDIO_ONLY-$(call ENCDEC,  PCM_S16BE,    AU)               += au
+FATE_LAVF_AUDIO_ONLY-$(call ENCDEC,  ADPCM_YAMAHA, MMF)              += mmf
+FATE_LAVF_AUDIO_ONLY-$(call ENCDEC,  FLAC,         OGG)              += ogg
+FATE_LAVF_AUDIO_ONLY-$(call ENCDEC,  PCM_U8,       RSO)              += rso
+FATE_LAVF_AUDIO_ONLY-$(call ENCDEC,  PCM_S16LE,    SOX)              += sox
+FATE_LAVF_AUDIO_ONLY-$(call ENCDEC,  PCM_MULAW,    PCM_MULAW)        += ul
+FATE_LAVF_AUDIO_ONLY-$(call ENCDEC,  PCM_U8,       VOC)              += voc
+FATE_LAVF_AUDIO_ONLY-$(call ENCDEC,  PCM_S16LE,    VOC)              += voc_s16
+FATE_LAVF_AUDIO_ONLY-$(call ENCDEC,  PCM_S16LE,    WAV)              += wav
+
+FATE_LAVF_AUDIO_ONLY = $(FATE_LAVF_AUDIO_ONLY-yes:%=fate-lavf-%)
+
+$(FATE_LAVF_AUDIO_ONLY): CMD = audio_only
+$(FATE_LAVF_AUDIO_ONLY): REF = $(SRC_PATH)/tests/ref/lavf/$(@:fate-lavf-%=%)
+$(FATE_LAVF_AUDIO_ONLY): $(AREF)
+
+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_PIPE-$(call ENCDEC,  PBM,              IMAGE2PIPE)         += pbmpipe
 FATE_LAVF_PIPE-$(call ENCDEC,  PGM,              IMAGE2PIPE)         += pgmpipe
 FATE_LAVF_PIPE-$(call ENCDEC,  PPM,              IMAGE2PIPE)         += ppmpipe
@@ -55,5 +66,5 @@  FATE_LAVF += fate-lavf-pixfmt
 $(FATE_LAVF): $(AREF) $(VREF)
 $(FATE_LAVF): CMD = lavftest
 
-FATE_AVCONV += $(FATE_LAVF) $(FATE_LAVF_PIPE)
-fate-lavf:     $(FATE_LAVF) $(FATE_LAVF_PIPE)
+FATE_AVCONV += $(FATE_LAVF) $(FATE_LAVF_AUDIO_ONLY) $(FATE_LAVF_PIPE)
+fate-lavf:     $(FATE_LAVF) $(FATE_LAVF_AUDIO_ONLY) $(FATE_LAVF_PIPE)
diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh
index dd73476669..66248f76d5 100755
--- a/tests/lavf-regression.sh
+++ b/tests/lavf-regression.sh
@@ -29,13 +29,6 @@  do_image_formats()
     echo $(wc -c ${outdir}02.$test)
 }
 
-do_audio_only()
-{
-    file=${outdir}lavf.$test
-    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
-}
-
 if [ -n "$do_avi" ] ; then
 do_lavf "" "-c:a mp2 -ar 44100"
 fi
@@ -168,52 +161,6 @@  if [ -n "$do_sun" ] ; then
 do_image_formats
 fi
 
-# audio only
-
-if [ -n "$do_wav" ] ; then
-do_audio_only
-fi
-
-if [ -n "$do_al" ] ; then
-do_audio_only "" "" "-ar 44100"
-fi
-
-if [ -n "$do_ul" ] ; then
-do_audio_only "" "" "-ar 44100"
-fi
-
-if [ -n "$do_au" ] ; then
-do_audio_only
-fi
-
-if [ -n "$do_mmf" ] ; then
-do_audio_only
-fi
-
-if [ -n "$do_aiff" ] ; then
-do_audio_only
-fi
-
-if [ -n "$do_voc" ] ; then
-do_audio_only
-fi
-
-if [ -n "$do_voc_s16" ] ; then
-do_audio_only "-ac 2" "-c:a pcm_s16le -f voc"
-fi
-
-if [ -n "$do_ogg" ] ; then
-do_audio_only "" "-c:a flac"
-fi
-
-if [ -n "$do_rso" ] ; then
-do_audio_only
-fi
-
-if [ -n "$do_sox" ] ; then
-do_audio_only
-fi
-
 # pix_fmt conversions
 
 if [ -n "$do_pixfmt" ] ; then
diff --git a/tests/ref/lavf/aiff b/tests/ref/lavf/aiff
index 4e4c25e2e7..e8868a6449 100644
--- a/tests/ref/lavf/aiff
+++ b/tests/ref/lavf/aiff
@@ -1,3 +1,3 @@ 
-9d9e55431800bf6aea46a7d67509da4e *./tests/data/fate/lavf.aiff
-88254 ./tests/data/fate/lavf.aiff
-./tests/data/fate/lavf.aiff CRC=0x3a1da17e
+9d9e55431800bf6aea46a7d67509da4e *tests/data/fate/lavf.aiff
+88254 tests/data/fate/lavf.aiff
+tests/data/fate/lavf.aiff CRC=0x3a1da17e
diff --git a/tests/ref/lavf/al b/tests/ref/lavf/al
index 3370149b03..bc7f18e241 100644
--- a/tests/ref/lavf/al
+++ b/tests/ref/lavf/al
@@ -1,3 +1,3 @@ 
-652d96e474869ddb01403743deb35117 *./tests/data/fate/lavf.al
-44100 ./tests/data/fate/lavf.al
-./tests/data/fate/lavf.al CRC=0xf9643112
+652d96e474869ddb01403743deb35117 *tests/data/fate/lavf.al
+44100 tests/data/fate/lavf.al
+tests/data/fate/lavf.al CRC=0xf9643112
diff --git a/tests/ref/lavf/au b/tests/ref/lavf/au
index d5a4dddc49..6de5904a6d 100644
--- a/tests/ref/lavf/au
+++ b/tests/ref/lavf/au
@@ -1,3 +1,3 @@ 
-b9396e3775ea009094e751e7128d614e *./tests/data/fate/lavf.au
-88224 ./tests/data/fate/lavf.au
-./tests/data/fate/lavf.au CRC=0x3a1da17e
+b9396e3775ea009094e751e7128d614e *tests/data/fate/lavf.au
+88224 tests/data/fate/lavf.au
+tests/data/fate/lavf.au CRC=0x3a1da17e
diff --git a/tests/ref/lavf/mmf b/tests/ref/lavf/mmf
index 89538c4751..043d8e7b8b 100644
--- a/tests/ref/lavf/mmf
+++ b/tests/ref/lavf/mmf
@@ -1,3 +1,3 @@ 
-1a3bbf19a41668c1e928bcafce88ff3e *./tests/data/fate/lavf.mmf
-22617 ./tests/data/fate/lavf.mmf
-./tests/data/fate/lavf.mmf CRC=0x8dea1388
+1a3bbf19a41668c1e928bcafce88ff3e *tests/data/fate/lavf.mmf
+22617 tests/data/fate/lavf.mmf
+tests/data/fate/lavf.mmf CRC=0x8dea1388
diff --git a/tests/ref/lavf/ogg b/tests/ref/lavf/ogg
index 0c35085358..032bbd0742 100644
--- a/tests/ref/lavf/ogg
+++ b/tests/ref/lavf/ogg
@@ -1,3 +1,3 @@ 
-8ca901bc8d24b80ebe79e387e454d1e9 *./tests/data/fate/lavf.ogg
-13476 ./tests/data/fate/lavf.ogg
-./tests/data/fate/lavf.ogg CRC=0x3a1da17e
+8ca901bc8d24b80ebe79e387e454d1e9 *tests/data/fate/lavf.ogg
+13476 tests/data/fate/lavf.ogg
+tests/data/fate/lavf.ogg CRC=0x3a1da17e
diff --git a/tests/ref/lavf/rso b/tests/ref/lavf/rso
index a7b88904a6..138f1a6340 100644
--- a/tests/ref/lavf/rso
+++ b/tests/ref/lavf/rso
@@ -1,3 +1,3 @@ 
-443b72346065d6318ca18c8395aa1d87 *./tests/data/fate/lavf.rso
-44108 ./tests/data/fate/lavf.rso
-./tests/data/fate/lavf.rso CRC=0x298fd284
+443b72346065d6318ca18c8395aa1d87 *tests/data/fate/lavf.rso
+44108 tests/data/fate/lavf.rso
+tests/data/fate/lavf.rso CRC=0x298fd284
diff --git a/tests/ref/lavf/sox b/tests/ref/lavf/sox
index 3e4c291333..b078a2922c 100644
--- a/tests/ref/lavf/sox
+++ b/tests/ref/lavf/sox
@@ -1,3 +1,3 @@ 
-683635d5cb1344e44fa96df90c3a993c *./tests/data/fate/lavf.sox
-176432 ./tests/data/fate/lavf.sox
-./tests/data/fate/lavf.sox CRC=0x3a1da17e
+683635d5cb1344e44fa96df90c3a993c *tests/data/fate/lavf.sox
+176432 tests/data/fate/lavf.sox
+tests/data/fate/lavf.sox CRC=0x3a1da17e
diff --git a/tests/ref/lavf/ul b/tests/ref/lavf/ul
index 1c4455e038..1f4dedf8a4 100644
--- a/tests/ref/lavf/ul
+++ b/tests/ref/lavf/ul
@@ -1,3 +1,3 @@ 
-ad492935e361f830f2f8302aa102701d *./tests/data/fate/lavf.ul
-44100 ./tests/data/fate/lavf.ul
-./tests/data/fate/lavf.ul CRC=0x4515fa26
+ad492935e361f830f2f8302aa102701d *tests/data/fate/lavf.ul
+44100 tests/data/fate/lavf.ul
+tests/data/fate/lavf.ul CRC=0x4515fa26
diff --git a/tests/ref/lavf/voc b/tests/ref/lavf/voc
index 2128593379..0dbbcc8364 100644
--- a/tests/ref/lavf/voc
+++ b/tests/ref/lavf/voc
@@ -1,3 +1,3 @@ 
-ae01db5200e569371d4c27316575344c *./tests/data/fate/lavf.voc
-44305 ./tests/data/fate/lavf.voc
-./tests/data/fate/lavf.voc CRC=0x298fd284
+ae01db5200e569371d4c27316575344c *tests/data/fate/lavf.voc
+44305 tests/data/fate/lavf.voc
+tests/data/fate/lavf.voc CRC=0x298fd284
diff --git a/tests/ref/lavf/voc_s16 b/tests/ref/lavf/voc_s16
index 865c0942a8..cb4c6e83dd 100644
--- a/tests/ref/lavf/voc_s16
+++ b/tests/ref/lavf/voc_s16
@@ -1,3 +1,3 @@ 
-e55a9c632cfeab90bcfb9ff29a71728c *./tests/data/fate/lavf.voc_s16
-176613 ./tests/data/fate/lavf.voc_s16
-./tests/data/fate/lavf.voc_s16 CRC=0xe61e3bd0
+e55a9c632cfeab90bcfb9ff29a71728c *tests/data/fate/lavf.voc_s16
+176613 tests/data/fate/lavf.voc_s16
+tests/data/fate/lavf.voc_s16 CRC=0xe61e3bd0
diff --git a/tests/ref/lavf/wav b/tests/ref/lavf/wav
index 498255a497..93c18f385c 100644
--- a/tests/ref/lavf/wav
+++ b/tests/ref/lavf/wav
@@ -1,3 +1,3 @@ 
-41410d9bbe0603740d1c17050746f475 *./tests/data/fate/lavf.wav
-88246 ./tests/data/fate/lavf.wav
-./tests/data/fate/lavf.wav CRC=0x3a1da17e
+41410d9bbe0603740d1c17050746f475 *tests/data/fate/lavf.wav
+88246 tests/data/fate/lavf.wav
+tests/data/fate/lavf.wav CRC=0x3a1da17e