Makefile 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
  2. THREADS = 1
  3. VREF = tests/vsynth1/00.pgm
  4. AREF = tests/data/asynth1.sw
  5. FATEW = 34
  6. FATEH = 34
  7. $(AREF): CMP=
  8. ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
  9. @echo
  10. @echo "Unfortunately ffserver is broken and therefore its regression"
  11. @echo "test fails randomly. Treat the results accordingly."
  12. @echo
  13. $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
  14. OBJDIRS += tests/data tests/vsynth1 tests/data/filtergraphs
  15. $(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth1
  16. $(M)./$< 'tests/vsynth1/'
  17. $(AREF): tests/audiogen$(HOSTEXESUF) | tests/data
  18. $(M)./$< $@
  19. tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data
  20. $(M)./$< $@ $(subst -, ,$*)
  21. tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
  22. $(M)$< $@
  23. tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
  24. $(M)$< $(SRC_PATH)/tests/reference.pnm $@
  25. tests/data/vsynth_lena.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
  26. $(M)$< $(SAMPLES)/lena.pnm $@
  27. tests/data/vsynth3.yuv: tests/videogen$(HOSTEXESUF) | tests/data
  28. $(M)$< $@ $(FATEW) $(FATEH)
  29. tests/test_copy.ffmeta: TAG = COPY
  30. tests/test_copy.ffmeta: tests/data
  31. $(M)cp -f $(SRC_PATH)/tests/test.ffmeta tests/test_copy.ffmeta
  32. tests/data/ffprobe-test.nut: ffmpeg$(EXESUF) tests/test_copy.ffmeta
  33. $(M)$(TARGET_EXEC) ./$< \
  34. -f lavfi -i "aevalsrc=sin(400*PI*2*t):d=0.125[out0]; testsrc=d=0.125[out1]; testsrc=s=100x100:d=0.125[out2]" \
  35. -f ffmetadata -i $(TARGET_PATH)/tests/test_copy.ffmeta \
  36. -flags +bitexact -map 0:0 -map 0:1 -map 0:2 -map_metadata 1 \
  37. -map_metadata:s:0 1:s:0 -map_metadata:s:1 1:s:1 \
  38. -vcodec rawvideo -acodec pcm_s16le \
  39. -y $(TARGET_PATH)/$@ 2>/dev/null
  40. tests/data/%.sw tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm tests/data/%.nut: TAG = GEN
  41. tests/data/filtergraphs/%: TAG = COPY
  42. tests/data/filtergraphs/%: $(SRC_PATH)/tests/filtergraphs/% | tests/data/filtergraphs
  43. $(M)cp $< $@
  44. RUNNING_FATE := $(filter check fate%,$(filter-out fate-rsync,$(MAKECMDGOALS)))
  45. # Check sanity of dependencies when running FATE tests.
  46. ifneq (,$(RUNNING_FATE))
  47. CHKCFG = $(if $($(1))$(!$(1)),$($(1)), $(error No such config: $(1)))
  48. endif
  49. ALLYES = $(strip $(call XYES, $(1)))
  50. XYES = $(if $(strip $(1)), \
  51. $(if $(call CHKCFG,CONFIG_$(firstword $(1))), \
  52. $(call XYES, $(wordlist 2, $(words $(1)), $(1)))), \
  53. yes)
  54. ENCDEC = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \
  55. $(firstword $(2))_MUXER $(lastword $(2))_DEMUXER)
  56. ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \
  57. $(firstword $(2))_ENCODER $(lastword $(2))_DECODER \
  58. $(firstword $(3))_MUXER $(lastword $(3))_DEMUXER)
  59. DEMDEC = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER))
  60. ENCMUX = $(call ALLYES, $(1:%=%_ENCODER) $(2)_MUXER)
  61. DEMMUX = $(call ALLYES, $(1)_DEMUXER $(2)_MUXER)
  62. FILTERDEMDEC = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER)
  63. FILTERDEMDECMUX = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_MUXER)
  64. FILTERDEMDECENCMUX = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_ENCODER $(5)_MUXER)
  65. PARSERDEMDEC = $(call ALLYES, $(1)_PARSER $(2)_DEMUXER $(3)_DECODER)
  66. include $(SRC_PATH)/tests/fate/acodec.mak
  67. include $(SRC_PATH)/tests/fate/vcodec.mak
  68. include $(SRC_PATH)/tests/fate/avformat.mak
  69. include $(SRC_PATH)/tests/fate/seek.mak
  70. include $(SRC_PATH)/tests/fate/aac.mak
  71. include $(SRC_PATH)/tests/fate/ac3.mak
  72. include $(SRC_PATH)/tests/fate/adpcm.mak
  73. include $(SRC_PATH)/tests/fate/alac.mak
  74. include $(SRC_PATH)/tests/fate/als.mak
  75. include $(SRC_PATH)/tests/fate/amrnb.mak
  76. include $(SRC_PATH)/tests/fate/amrwb.mak
  77. include $(SRC_PATH)/tests/fate/atrac.mak
  78. include $(SRC_PATH)/tests/fate/audio.mak
  79. include $(SRC_PATH)/tests/fate/bmp.mak
  80. include $(SRC_PATH)/tests/fate/cdxl.mak
  81. include $(SRC_PATH)/tests/fate/cover-art.mak
  82. include $(SRC_PATH)/tests/fate/demux.mak
  83. include $(SRC_PATH)/tests/fate/dfa.mak
  84. include $(SRC_PATH)/tests/fate/dpcm.mak
  85. include $(SRC_PATH)/tests/fate/ea.mak
  86. include $(SRC_PATH)/tests/fate/exif.mak
  87. include $(SRC_PATH)/tests/fate/ffmpeg.mak
  88. include $(SRC_PATH)/tests/fate/ffprobe.mak
  89. include $(SRC_PATH)/tests/fate/filter-audio.mak
  90. include $(SRC_PATH)/tests/fate/filter-video.mak
  91. include $(SRC_PATH)/tests/fate/flac.mak
  92. include $(SRC_PATH)/tests/fate/fft.mak
  93. include $(SRC_PATH)/tests/fate/gif.mak
  94. include $(SRC_PATH)/tests/fate/h264.mak
  95. include $(SRC_PATH)/tests/fate/hevc.mak
  96. include $(SRC_PATH)/tests/fate/image.mak
  97. include $(SRC_PATH)/tests/fate/indeo.mak
  98. include $(SRC_PATH)/tests/fate/libavcodec.mak
  99. include $(SRC_PATH)/tests/fate/libavdevice.mak
  100. include $(SRC_PATH)/tests/fate/libavformat.mak
  101. include $(SRC_PATH)/tests/fate/libavresample.mak
  102. include $(SRC_PATH)/tests/fate/libavutil.mak
  103. include $(SRC_PATH)/tests/fate/libswresample.mak
  104. include $(SRC_PATH)/tests/fate/lossless-audio.mak
  105. include $(SRC_PATH)/tests/fate/lossless-video.mak
  106. include $(SRC_PATH)/tests/fate/microsoft.mak
  107. include $(SRC_PATH)/tests/fate/monkeysaudio.mak
  108. include $(SRC_PATH)/tests/fate/mp3.mak
  109. include $(SRC_PATH)/tests/fate/mpc.mak
  110. include $(SRC_PATH)/tests/fate/mpeg4.mak
  111. include $(SRC_PATH)/tests/fate/opus.mak
  112. include $(SRC_PATH)/tests/fate/pcm.mak
  113. include $(SRC_PATH)/tests/fate/probe.mak
  114. include $(SRC_PATH)/tests/fate/prores.mak
  115. include $(SRC_PATH)/tests/fate/qt.mak
  116. include $(SRC_PATH)/tests/fate/qtrle.mak
  117. include $(SRC_PATH)/tests/fate/real.mak
  118. include $(SRC_PATH)/tests/fate/screen.mak
  119. include $(SRC_PATH)/tests/fate/subtitles.mak
  120. include $(SRC_PATH)/tests/fate/utvideo.mak
  121. include $(SRC_PATH)/tests/fate/video.mak
  122. include $(SRC_PATH)/tests/fate/voice.mak
  123. include $(SRC_PATH)/tests/fate/vorbis.mak
  124. include $(SRC_PATH)/tests/fate/vpx.mak
  125. include $(SRC_PATH)/tests/fate/vqf.mak
  126. include $(SRC_PATH)/tests/fate/wavpack.mak
  127. include $(SRC_PATH)/tests/fate/wma.mak
  128. include $(SRC_PATH)/tests/fate/xvid.mak
  129. FATE_FFMPEG += $(FATE_FFMPEG-yes) $(FATE_AVCONV) $(FATE_AVCONV-yes)
  130. FATE-$(CONFIG_FFMPEG) += $(FATE_FFMPEG)
  131. FATE-$(CONFIG_FFPROBE) += $(FATE_FFPROBE)
  132. FATE_SAMPLES_AVCONV += $(FATE_SAMPLES_AVCONV-yes)
  133. FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_FFMPEG-yes)
  134. FATE_EXTERN-$(CONFIG_FFMPEG) += $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG) $(FATE_SAMPLES_FFPROBE)
  135. FATE_EXTERN += $(FATE_EXTERN-yes)
  136. FATE += $(FATE-yes)
  137. RSYNC_OPTIONS-$(HAVE_RSYNC_CONTIMEOUT) += --contimeout=60
  138. RSYNC_OPTIONS = -vrltLW --timeout=60 $(RSYNC_OPTIONS-yes)
  139. $(FATE_FFMPEG) $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG): ffmpeg$(EXESUF)
  140. $(FATE_FFPROBE) $(FATE_SAMPLES_FFPROBE): ffprobe$(EXESUF)
  141. ifdef SAMPLES
  142. FATE += $(FATE_FULL) $(FATE_FULL-yes)
  143. FATE += $(FATE_EXTERN)
  144. fate-rsync:
  145. rsync $(RSYNC_OPTIONS) rsync://fate-suite.ffmpeg.org/fate-suite/ $(SAMPLES)
  146. else
  147. fate::
  148. @echo "warning: only a subset of the fate tests will be run because SAMPLES is not specified"
  149. fate-rsync:
  150. @echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
  151. $(FATE_EXTERN):
  152. @echo "$@ requires external samples and SAMPLES not specified"; false
  153. endif
  154. FATE_UTILS = base64 tiny_psnr tiny_ssim
  155. TOOL = ffmpeg
  156. fate:: $(FATE)
  157. $(FATE) $(FATE_TESTS-no): $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
  158. @echo "TEST $(@:fate-%=%)"
  159. $(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(TARGET_SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)' '$(CPUFLAGS)' '$(CMP_SHIFT)' '$(CMP_TARGET)' '$(SIZE_TOLERANCE)' '$(CMP_UNIT)' '$(GEN)'
  160. fate-list:
  161. @printf '%s\n' $(sort $(FATE))
  162. coverage.info: TAG = LCOV
  163. coverage.info:
  164. $(M)lcov -q -d $(CURDIR) -b $(SRC_PATH) --capture | \
  165. sed "s,$(CURDIR)/\./,$(CURDIR)/," > $@
  166. $(M)lcov -q --remove $@ "/usr*" -o $@
  167. lcov: TAG = GENHTML
  168. lcov: coverage.info
  169. $(M)genhtml -q -o $(CURDIR)/lcov $<
  170. lcov-reset: TAG = LCOV
  171. lcov-reset:
  172. $(M)lcov -d $(CURDIR) --zerocounters
  173. $(Q)$(RM) -f coverage.info
  174. clean:: testclean
  175. testclean:
  176. $(RM) -r tests/vsynth1 tests/data tools/lavfi-showfiltfmts$(EXESUF)
  177. $(RM) $(CLEANSUFFIXES:%=tests/%)
  178. $(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
  179. $(RM) tests/pixfmts.mak tests/test_copy.ffmeta
  180. -include $(wildcard tests/*.d)
  181. .PHONY: fate* lcov lcov-reset
  182. .INTERMEDIATE: coverage.info