Makefile 7.5 KB

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