Makefile 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. THREADS = 1
  2. VREF = tests/vsynth1/00.pgm
  3. AREF = tests/data/asynth1.sw
  4. FATEW = 34
  5. FATEH = 34
  6. FFMPEG=ffmpeg$(PROGSSUF)$(EXESUF)
  7. $(AREF): CMP=
  8. APITESTSDIR := tests/api
  9. FATE_OUTDIRS = tests/data tests/data/fate tests/data/filtergraphs tests/data/lavf tests/data/lavf-fate tests/data/pixfmt tests/vsynth1 $(APITESTSDIR)
  10. OUTDIRS += $(FATE_OUTDIRS)
  11. $(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth1
  12. $(M)./$< 'tests/vsynth1/'
  13. $(AREF): tests/audiogen$(HOSTEXESUF) | tests/data
  14. $(M)./$< $@
  15. tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data
  16. $(M)./$< $@ $(subst -, ,$*)
  17. tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
  18. $(M)$< $@
  19. tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
  20. $(M)$< $(SRC_PATH)/tests/reference.pnm $@
  21. tests/data/vsynth_lena.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
  22. $(M)$< $(SAMPLES)/lena.pnm $@
  23. tests/data/vsynth3.yuv: tests/videogen$(HOSTEXESUF) | tests/data
  24. $(M)$< $@ $(FATEW) $(FATEH)
  25. tests/test_copy.ffmeta: TAG = COPY
  26. tests/test_copy.ffmeta: tests/data
  27. $(M)cp -f $(SRC_PATH)/tests/test.ffmeta tests/test_copy.ffmeta
  28. tests/data/ffprobe-test.nut: ffmpeg$(PROGSSUF)$(EXESUF) tests/test_copy.ffmeta
  29. $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
  30. -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]" \
  31. -f ffmetadata -i $(TARGET_PATH)/tests/test_copy.ffmeta \
  32. -flags +bitexact -fflags +bitexact -map 0:0 -map 0:1 -map 0:2 -map_metadata 1 \
  33. -map_metadata:s:0 1:s:0 -map_metadata:s:1 1:s:1 \
  34. -vcodec rawvideo -acodec pcm_s16le \
  35. -y $(TARGET_PATH)/$@ 2>/dev/null
  36. tests/data/%.sw tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm tests/data/%.nut: TAG = GEN
  37. tests/data/filtergraphs/%: TAG = COPY
  38. tests/data/filtergraphs/%: $(SRC_PATH)/tests/filtergraphs/% | tests/data/filtergraphs
  39. $(M)cp $< $@
  40. RUNNING_FATE := $(filter check fate%,$(filter-out fate-rsync,$(MAKECMDGOALS)))
  41. # Check sanity of dependencies when running FATE tests.
  42. ifneq (,$(RUNNING_FATE))
  43. CHKCFG = $(if $($(1))$(!$(1)),$($(1)), $(error No such config: $(1)))
  44. endif
  45. ALLYES = $(strip $(call XYES, $(1)))
  46. XYES = $(if $(strip $(1)), \
  47. $(if $(call CHKCFG,CONFIG_$(firstword $(1))), \
  48. $(call XYES, $(wordlist 2, $(words $(1)), $(1)))), \
  49. yes)
  50. ENCDEC = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \
  51. $(firstword $(2))_MUXER $(lastword $(2))_DEMUXER)
  52. ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \
  53. $(firstword $(2))_ENCODER $(lastword $(2))_DECODER \
  54. $(firstword $(3))_MUXER $(lastword $(3))_DEMUXER)
  55. DEMDEC = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER))
  56. ENCMUX = $(call ALLYES, $(1:%=%_ENCODER) $(2)_MUXER)
  57. DEMMUX = $(call ALLYES, $(1)_DEMUXER $(2)_MUXER)
  58. FILTERDEMDEC = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER)
  59. FILTERDEMDECMUX = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_MUXER)
  60. FILTERDEMDECENCMUX = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_ENCODER $(5)_MUXER)
  61. PARSERDEMDEC = $(call ALLYES, $(1)_PARSER $(2)_DEMUXER $(3)_DECODER)
  62. include $(SRC_PATH)/$(APITESTSDIR)/Makefile
  63. include $(SRC_PATH)/tests/fate/acodec.mak
  64. include $(SRC_PATH)/tests/fate/vcodec.mak
  65. include $(SRC_PATH)/tests/fate/lavf-audio.mak
  66. include $(SRC_PATH)/tests/fate/lavf-container.mak
  67. include $(SRC_PATH)/tests/fate/lavf-image.mak
  68. include $(SRC_PATH)/tests/fate/lavf-image2pipe.mak
  69. include $(SRC_PATH)/tests/fate/lavf-video.mak
  70. include $(SRC_PATH)/tests/fate/seek.mak
  71. include $(SRC_PATH)/tests/fate/aac.mak
  72. include $(SRC_PATH)/tests/fate/ac3.mak
  73. include $(SRC_PATH)/tests/fate/adpcm.mak
  74. include $(SRC_PATH)/tests/fate/alac.mak
  75. include $(SRC_PATH)/tests/fate/als.mak
  76. include $(SRC_PATH)/tests/fate/amrnb.mak
  77. include $(SRC_PATH)/tests/fate/amrwb.mak
  78. include $(SRC_PATH)/tests/fate/api.mak
  79. include $(SRC_PATH)/tests/fate/apng.mak
  80. include $(SRC_PATH)/tests/fate/atrac.mak
  81. include $(SRC_PATH)/tests/fate/audio.mak
  82. include $(SRC_PATH)/tests/fate/bmp.mak
  83. include $(SRC_PATH)/tests/fate/build.mak
  84. include $(SRC_PATH)/tests/fate/canopus.mak
  85. include $(SRC_PATH)/tests/fate/cbs.mak
  86. include $(SRC_PATH)/tests/fate/cdxl.mak
  87. include $(SRC_PATH)/tests/fate/checkasm.mak
  88. include $(SRC_PATH)/tests/fate/concatdec.mak
  89. include $(SRC_PATH)/tests/fate/cover-art.mak
  90. include $(SRC_PATH)/tests/fate/dca.mak
  91. include $(SRC_PATH)/tests/fate/demux.mak
  92. include $(SRC_PATH)/tests/fate/dfa.mak
  93. include $(SRC_PATH)/tests/fate/dnxhd.mak
  94. include $(SRC_PATH)/tests/fate/dpcm.mak
  95. include $(SRC_PATH)/tests/fate/ea.mak
  96. include $(SRC_PATH)/tests/fate/exif.mak
  97. include $(SRC_PATH)/tests/fate/ffmpeg.mak
  98. include $(SRC_PATH)/tests/fate/ffprobe.mak
  99. include $(SRC_PATH)/tests/fate/fft.mak
  100. include $(SRC_PATH)/tests/fate/fifo-muxer.mak
  101. include $(SRC_PATH)/tests/fate/filter-audio.mak
  102. include $(SRC_PATH)/tests/fate/filter-video.mak
  103. include $(SRC_PATH)/tests/fate/fits.mak
  104. include $(SRC_PATH)/tests/fate/flac.mak
  105. include $(SRC_PATH)/tests/fate/flvenc.mak
  106. include $(SRC_PATH)/tests/fate/gapless.mak
  107. include $(SRC_PATH)/tests/fate/gif.mak
  108. include $(SRC_PATH)/tests/fate/h264.mak
  109. include $(SRC_PATH)/tests/fate/hap.mak
  110. include $(SRC_PATH)/tests/fate/hevc.mak
  111. include $(SRC_PATH)/tests/fate/hlsenc.mak
  112. include $(SRC_PATH)/tests/fate/hw.mak
  113. include $(SRC_PATH)/tests/fate/id3v2.mak
  114. include $(SRC_PATH)/tests/fate/image.mak
  115. include $(SRC_PATH)/tests/fate/indeo.mak
  116. include $(SRC_PATH)/tests/fate/libavcodec.mak
  117. include $(SRC_PATH)/tests/fate/libavdevice.mak
  118. include $(SRC_PATH)/tests/fate/libavformat.mak
  119. include $(SRC_PATH)/tests/fate/libavresample.mak
  120. include $(SRC_PATH)/tests/fate/libavutil.mak
  121. include $(SRC_PATH)/tests/fate/libswresample.mak
  122. include $(SRC_PATH)/tests/fate/libswscale.mak
  123. include $(SRC_PATH)/tests/fate/lossless-audio.mak
  124. include $(SRC_PATH)/tests/fate/lossless-video.mak
  125. include $(SRC_PATH)/tests/fate/matroska.mak
  126. include $(SRC_PATH)/tests/fate/microsoft.mak
  127. include $(SRC_PATH)/tests/fate/monkeysaudio.mak
  128. include $(SRC_PATH)/tests/fate/mov.mak
  129. include $(SRC_PATH)/tests/fate/mp3.mak
  130. include $(SRC_PATH)/tests/fate/mpc.mak
  131. include $(SRC_PATH)/tests/fate/mpeg4.mak
  132. include $(SRC_PATH)/tests/fate/mpegps.mak
  133. include $(SRC_PATH)/tests/fate/mpegts.mak
  134. include $(SRC_PATH)/tests/fate/mxf.mak
  135. include $(SRC_PATH)/tests/fate/opus.mak
  136. include $(SRC_PATH)/tests/fate/pcm.mak
  137. include $(SRC_PATH)/tests/fate/pixfmt.mak
  138. include $(SRC_PATH)/tests/fate/pixlet.mak
  139. include $(SRC_PATH)/tests/fate/probe.mak
  140. include $(SRC_PATH)/tests/fate/prores.mak
  141. include $(SRC_PATH)/tests/fate/qt.mak
  142. include $(SRC_PATH)/tests/fate/qtrle.mak
  143. include $(SRC_PATH)/tests/fate/real.mak
  144. include $(SRC_PATH)/tests/fate/screen.mak
  145. include $(SRC_PATH)/tests/fate/segment.mak
  146. include $(SRC_PATH)/tests/fate/source.mak
  147. include $(SRC_PATH)/tests/fate/speedhq.mak
  148. include $(SRC_PATH)/tests/fate/subtitles.mak
  149. include $(SRC_PATH)/tests/fate/utvideo.mak
  150. include $(SRC_PATH)/tests/fate/video.mak
  151. include $(SRC_PATH)/tests/fate/voice.mak
  152. include $(SRC_PATH)/tests/fate/vorbis.mak
  153. include $(SRC_PATH)/tests/fate/vpx.mak
  154. include $(SRC_PATH)/tests/fate/vqf.mak
  155. include $(SRC_PATH)/tests/fate/wavpack.mak
  156. include $(SRC_PATH)/tests/fate/wma.mak
  157. include $(SRC_PATH)/tests/fate/xvid.mak
  158. FATE_FFMPEG += $(FATE_FFMPEG-yes) $(FATE_AVCONV) $(FATE_AVCONV-yes)
  159. FATE-$(CONFIG_FFMPEG) += $(FATE_FFMPEG)
  160. FATE-$(CONFIG_FFPROBE) += $(FATE_FFPROBE)
  161. FATE_SAMPLES_AVCONV += $(FATE_SAMPLES_AVCONV-yes)
  162. FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_FFMPEG-yes)
  163. FATE_EXTERN-$(CONFIG_FFMPEG) += $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG) $(FATE_SAMPLES_FFPROBE) $(FATE_SAMPLES_FASTSTART)
  164. FATE_EXTERN += $(FATE_EXTERN-yes)
  165. FATE += $(FATE-yes)
  166. RSYNC_OPTIONS-$(HAVE_RSYNC_CONTIMEOUT) += --contimeout=60
  167. RSYNC_OPTIONS = -vrltLW --timeout=60 $(RSYNC_OPTIONS-yes)
  168. $(FATE_FFMPEG) $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG): ffmpeg$(PROGSSUF)$(EXESUF)
  169. $(FATE_FFPROBE) $(FATE_SAMPLES_FFPROBE): ffprobe$(PROGSSUF)$(EXESUF)
  170. $(FATE_SAMPLES_FASTSTART): tools/qt-faststart$(EXESUF)
  171. ifdef SAMPLES
  172. FATE += $(FATE_FULL) $(FATE_FULL-yes)
  173. FATE += $(FATE_EXTERN)
  174. fate-rsync:
  175. rsync $(RSYNC_OPTIONS) rsync://fate-suite.ffmpeg.org/fate-suite/ $(SAMPLES)
  176. else
  177. fate::
  178. @echo "warning: only a subset of the fate tests will be run because SAMPLES is not specified"
  179. fate-rsync:
  180. @echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
  181. $(FATE_EXTERN):
  182. @echo "$@ requires external samples and SAMPLES not specified"; false
  183. endif
  184. FATE_UTILS = base64 tiny_psnr tiny_ssim audiomatch
  185. TOOL = ffmpeg
  186. $(addprefix fate-, $(IGNORE_TESTS)): REPORT=ignore
  187. fate:: $(FATE)
  188. # Tests requiring hardware support are not included in a default fate run.
  189. fate-hw: $(FATE_HW-yes)
  190. FATE += $(FATE_HW-yes)
  191. $(FATE) $(FATE_TESTS-no): export PROGSUF = $(PROGSSUF)
  192. $(FATE) $(FATE_TESTS-no): export EXECSUF = $(EXESUF)
  193. $(FATE) $(FATE_TESTS-no): export HOSTEXECSUF = $(HOSTEXESUF)
  194. $(FATE) $(FATE_TESTS-no): $(FATE_UTILS:%=tests/%$(HOSTEXESUF)) | $(FATE_OUTDIRS)
  195. @echo "TEST $(@:fate-%=%)"
  196. $(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)' '$(HWACCEL)' '$(REPORT)' '$(KEEP)'
  197. fate-list:
  198. @printf '%s\n' $(sort $(FATE))
  199. coverage.info: TAG = LCOV
  200. coverage.info:
  201. $(M)lcov -q -d $(CURDIR) -b $(patsubst src%,./,$(SRC_LINK)) --capture | \
  202. sed "s,$(CURDIR)/\./,$(CURDIR)/," > $@.in
  203. $(M)lcov -q --remove $@.in "/usr*" > $@
  204. $(Q)$(RM) $@.in
  205. lcov: TAG = GENHTML
  206. lcov: coverage.info
  207. $(M)genhtml -q -o $(CURDIR)/lcov $<
  208. lcov-reset: TAG = LCOV
  209. lcov-reset:
  210. $(M)lcov -q -d $(CURDIR) --zerocounters
  211. $(Q)$(RM) -f coverage.info
  212. clean:: testclean
  213. testclean::
  214. $(RM) -r tests/vsynth1 tests/data tools/lavfi-showfiltfmts$(PROGSSUF)$(EXESUF)
  215. $(RM) $(CLEANSUFFIXES:%=tests/%)
  216. $(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
  217. $(RM) tests/pixfmts.mak tests/test_copy.ffmeta
  218. -include $(wildcard tests/*.d)
  219. include $(SRC_PATH)/tests/checkasm/Makefile
  220. .PHONY: fate* lcov lcov-reset
  221. .INTERMEDIATE: coverage.info