Makefile 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. ifneq ($(strip $(KEEP)),)
  2. ifneq ($(strip $(KEEP)),0)
  3. # KEEP_FILES is normally undefined; it is set to 2 # if the user requested
  4. # to keep all intermediate FATE-files by setting KEEP.
  5. # For some tests it is also set to 1 if it is unset; this indicates
  6. # that only some intermediate files (namely only non-raw files)
  7. # are to be kept. This allows reusing these intermediate files as input
  8. # files for other tests (mostly the seek-tests).
  9. KEEP_FILES = 2
  10. endif
  11. endif
  12. THREADS = 1
  13. VREF = tests/vsynth1/00.pgm
  14. AREF = tests/data/asynth1.sw
  15. FATEW = 34
  16. FATEH = 34
  17. FFMPEG=ffmpeg$(PROGSSUF)$(EXESUF)
  18. $(AREF): CMP=
  19. APITESTSDIR := tests/api
  20. FATE_OUTDIRS = tests/data tests/data/fate tests/data/filtergraphs tests/data/maps tests/data/streamgroups tests/data/lavf tests/data/lavf-fate tests/data/pixfmt tests/vsynth1 $(APITESTSDIR)
  21. OUTDIRS += $(FATE_OUTDIRS)
  22. $(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth1
  23. $(M)./$< 'tests/vsynth1/'
  24. $(AREF): tests/audiogen$(HOSTEXESUF) | tests/data
  25. $(M)./$< $@
  26. tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data
  27. $(M)./$< $@ $(subst -, ,$*)
  28. tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
  29. $(M)$< $@
  30. tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
  31. $(M)$< $(SRC_PATH)/tests/reference.pnm $@
  32. tests/data/vsynth_lena.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
  33. $(M)$< $(SAMPLES)/lena.pnm $@
  34. tests/data/vsynth3.yuv: tests/videogen$(HOSTEXESUF) | tests/data
  35. $(M)$< $@ $(FATEW) $(FATEH)
  36. tests/test_copy.ffmeta: TAG = COPY
  37. tests/test_copy.ffmeta: tests/data
  38. $(M)cp -f $(SRC_PATH)/tests/test.ffmeta tests/test_copy.ffmeta
  39. tests/data/%.sw tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm tests/data/%.nut: TAG = GEN
  40. tests/data/filtergraphs/%: TAG = COPY
  41. tests/data/filtergraphs/%: $(SRC_PATH)/tests/filtergraphs/% | tests/data/filtergraphs
  42. $(M)cp $< $@
  43. tests/data/maps/%: TAG = COPY
  44. tests/data/maps/%: $(SRC_PATH)/tests/maps/% | tests/data/maps
  45. $(M)cp $< $@
  46. tests/data/streamgroups/%: TAG = COPY
  47. tests/data/streamgroups/%: $(SRC_PATH)/tests/streamgroups/% | tests/data/streamgroups
  48. $(M)cp $< $@
  49. RUNNING_FATE := $(filter check fate%,$(filter-out fate-rsync,$(MAKECMDGOALS)))
  50. # Check sanity of dependencies when running FATE tests.
  51. ifneq (,$(RUNNING_FATE))
  52. CHKCFG = $(if $($(1))$(!$(1)),$($(1)), $(error No such config: $(1)))
  53. endif
  54. ALLYES = $(strip $(call XYES, $(1)))
  55. XYES = $(if $(strip $(1)), \
  56. $(if $(call CHKCFG,CONFIG_$(firstword $(1))), \
  57. $(call XYES, $(wordlist 2, $(words $(1)), $(1)))), \
  58. yes)
  59. ENCDEC = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \
  60. $(firstword $(2))_MUXER $(lastword $(2))_DEMUXER \
  61. $(3) FILE_PROTOCOL)
  62. ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \
  63. $(firstword $(2))_ENCODER $(lastword $(2))_DECODER \
  64. $(firstword $(3))_MUXER $(lastword $(3))_DEMUXER \
  65. $(4) FILE_PROTOCOL)
  66. # RAWVIDEO_ENCODER and PCM_S16LE_ENCODER corresponds to the default codecs
  67. # for framecrc. These requirements are not always necessary.
  68. TRANSCODE = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \
  69. $(firstword $(2))_MUXER $(lastword $(2))_DEMUXER \
  70. $(3) FILE_PROTOCOL PIPE_PROTOCOL RAWVIDEO_ENCODER \
  71. PCM_S16LE_ENCODER FRAMECRC_MUXER)
  72. REMUX = $(call ALLYES, $(firstword $(1))_MUXER $(lastword $(1))_DEMUXER \
  73. $(2) FILE_PROTOCOL PIPE_PROTOCOL FRAMECRC_MUXER)
  74. DEMDEC = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER) $(3) FILE_PROTOCOL)
  75. ENCMUX = $(call ALLYES, $(1:%=%_ENCODER) $(2)_MUXER $(3))
  76. FRAMEMD5 = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER) $(3) \
  77. PCM_S16LE_ENCODER RAWVIDEO_ENCODER FRAMEMD5_MUXER \
  78. PIPE_PROTOCOL FILE_PROTOCOL)
  79. FRAMECRC = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER) $(3) \
  80. PCM_S16LE_ENCODER RAWVIDEO_ENCODER FRAMECRC_MUXER \
  81. PIPE_PROTOCOL FILE_PROTOCOL)
  82. # Variant of DEMDEC for use with the "pcm" command.
  83. PCM = $(call ALLYES, $(1)_DEMUXER $(2)_DECODER $(3) FILE_PROTOCOL \
  84. PCM_S16LE_ENCODER PCM_S16LE_MUXER PIPE_PROTOCOL)
  85. DEMMUX = $(call ALLYES, $(1)_DEMUXER $(2)_MUXER $(3) FILE_PROTOCOL)
  86. # Variant of FRAMECRC for the cases with -lavfi where no demuxer is involved.
  87. FILTERFRAMECRC = $(call ALLYES, $(1:%=%_FILTER) $(2) PCM_S16LE_ENCODER \
  88. RAWVIDEO_ENCODER FRAMECRC_MUXER PIPE_PROTOCOL)
  89. # Specialization of FRAMECRC to be used when filtering is involved.
  90. FILTERDEMDEC = $(call ALLYES, $(1:%=%_FILTER) $(2:%=%_DEMUXER) $(3:%=%_DECODER) \
  91. $(4) PCM_S16LE_ENCODER RAWVIDEO_ENCODER \
  92. FRAMECRC_MUXER FILE_PROTOCOL PIPE_PROTOCOL)
  93. FILTERDEMDECENCMUX = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_ENCODER $(5)_MUXER $(6) FILE_PROTOCOL)
  94. PARSERDEMDEC = $(call ALLYES, $(1)_PARSER $(2)_DEMUXER $(3)_DECODER $(4) FILE_PROTOCOL)
  95. # Allow overriding CONFIG_LARGE_TESTS via LARGE_TESTS, if set on the
  96. # make command line.
  97. ifeq ($(LARGE_TESTS), yes)
  98. CONFIG_LARGE_TESTS:=yes
  99. !CONFIG_LARGE_TESTS:=
  100. else ifeq ($(LARGE_TESTS), no)
  101. CONFIG_LARGE_TESTS:=
  102. !CONFIG_LARGE_TESTS:=yes
  103. endif
  104. include $(SRC_PATH)/$(APITESTSDIR)/Makefile
  105. include $(SRC_PATH)/tests/fate/acodec.mak
  106. include $(SRC_PATH)/tests/fate/vcodec.mak
  107. include $(SRC_PATH)/tests/fate/lavf-audio.mak
  108. include $(SRC_PATH)/tests/fate/lavf-container.mak
  109. include $(SRC_PATH)/tests/fate/lavf-image.mak
  110. include $(SRC_PATH)/tests/fate/lavf-image2pipe.mak
  111. include $(SRC_PATH)/tests/fate/lavf-video.mak
  112. # Must be included after acodec.mak, vcodec.mak and lavf-*.mak
  113. include $(SRC_PATH)/tests/fate/seek.mak
  114. include $(SRC_PATH)/tests/fate/aac.mak
  115. include $(SRC_PATH)/tests/fate/ac3.mak
  116. include $(SRC_PATH)/tests/fate/adpcm.mak
  117. include $(SRC_PATH)/tests/fate/alac.mak
  118. include $(SRC_PATH)/tests/fate/als.mak
  119. include $(SRC_PATH)/tests/fate/amrnb.mak
  120. include $(SRC_PATH)/tests/fate/amrwb.mak
  121. include $(SRC_PATH)/tests/fate/api.mak
  122. include $(SRC_PATH)/tests/fate/apng.mak
  123. include $(SRC_PATH)/tests/fate/atrac.mak
  124. include $(SRC_PATH)/tests/fate/audio.mak
  125. include $(SRC_PATH)/tests/fate/bmp.mak
  126. include $(SRC_PATH)/tests/fate/build.mak
  127. include $(SRC_PATH)/tests/fate/caf.mak
  128. include $(SRC_PATH)/tests/fate/canopus.mak
  129. include $(SRC_PATH)/tests/fate/cbs.mak
  130. include $(SRC_PATH)/tests/fate/cdxl.mak
  131. include $(SRC_PATH)/tests/fate/checkasm.mak
  132. # Must be included after lavf-container.mak
  133. include $(SRC_PATH)/tests/fate/concatdec.mak
  134. include $(SRC_PATH)/tests/fate/cover-art.mak
  135. include $(SRC_PATH)/tests/fate/dca.mak
  136. include $(SRC_PATH)/tests/fate/demux.mak
  137. include $(SRC_PATH)/tests/fate/dfa.mak
  138. include $(SRC_PATH)/tests/fate/dnxhd.mak
  139. include $(SRC_PATH)/tests/fate/dpcm.mak
  140. include $(SRC_PATH)/tests/fate/dvvideo.mak
  141. include $(SRC_PATH)/tests/fate/ea.mak
  142. include $(SRC_PATH)/tests/fate/exif.mak
  143. include $(SRC_PATH)/tests/fate/enc_external.mak
  144. # Must be included after lavf-video.mak
  145. include $(SRC_PATH)/tests/fate/ffmpeg.mak
  146. include $(SRC_PATH)/tests/fate/ffprobe.mak
  147. include $(SRC_PATH)/tests/fate/fifo-muxer.mak
  148. include $(SRC_PATH)/tests/fate/filter-audio.mak
  149. # Must be included after vcodec.mak
  150. include $(SRC_PATH)/tests/fate/filter-video.mak
  151. include $(SRC_PATH)/tests/fate/fits.mak
  152. include $(SRC_PATH)/tests/fate/flac.mak
  153. include $(SRC_PATH)/tests/fate/flvenc.mak
  154. include $(SRC_PATH)/tests/fate/gapless.mak
  155. include $(SRC_PATH)/tests/fate/gif.mak
  156. include $(SRC_PATH)/tests/fate/h264.mak
  157. include $(SRC_PATH)/tests/fate/hap.mak
  158. include $(SRC_PATH)/tests/fate/hevc.mak
  159. include $(SRC_PATH)/tests/fate/hlsenc.mak
  160. include $(SRC_PATH)/tests/fate/hw.mak
  161. include $(SRC_PATH)/tests/fate/iamf.mak
  162. include $(SRC_PATH)/tests/fate/id3v2.mak
  163. include $(SRC_PATH)/tests/fate/image.mak
  164. include $(SRC_PATH)/tests/fate/imf.mak
  165. include $(SRC_PATH)/tests/fate/indeo.mak
  166. include $(SRC_PATH)/tests/fate/jpeg2000.mak
  167. include $(SRC_PATH)/tests/fate/jxl.mak
  168. include $(SRC_PATH)/tests/fate/libavcodec.mak
  169. include $(SRC_PATH)/tests/fate/libavdevice.mak
  170. include $(SRC_PATH)/tests/fate/libavformat.mak
  171. include $(SRC_PATH)/tests/fate/libavutil.mak
  172. include $(SRC_PATH)/tests/fate/libswresample.mak
  173. include $(SRC_PATH)/tests/fate/libswscale.mak
  174. include $(SRC_PATH)/tests/fate/lossless-audio.mak
  175. include $(SRC_PATH)/tests/fate/lossless-video.mak
  176. include $(SRC_PATH)/tests/fate/matroska.mak
  177. include $(SRC_PATH)/tests/fate/microsoft.mak
  178. include $(SRC_PATH)/tests/fate/monkeysaudio.mak
  179. include $(SRC_PATH)/tests/fate/mov.mak
  180. include $(SRC_PATH)/tests/fate/mp3.mak
  181. include $(SRC_PATH)/tests/fate/mpc.mak
  182. include $(SRC_PATH)/tests/fate/mpeg4.mak
  183. include $(SRC_PATH)/tests/fate/mpegps.mak
  184. include $(SRC_PATH)/tests/fate/mpegts.mak
  185. include $(SRC_PATH)/tests/fate/mxf.mak
  186. include $(SRC_PATH)/tests/fate/oma.mak
  187. include $(SRC_PATH)/tests/fate/opus.mak
  188. include $(SRC_PATH)/tests/fate/pcm.mak
  189. include $(SRC_PATH)/tests/fate/pixfmt.mak
  190. include $(SRC_PATH)/tests/fate/pixlet.mak
  191. include $(SRC_PATH)/tests/fate/probe.mak
  192. include $(SRC_PATH)/tests/fate/prores.mak
  193. include $(SRC_PATH)/tests/fate/qoa.mak
  194. include $(SRC_PATH)/tests/fate/qt.mak
  195. include $(SRC_PATH)/tests/fate/qtrle.mak
  196. include $(SRC_PATH)/tests/fate/real.mak
  197. include $(SRC_PATH)/tests/fate/screen.mak
  198. include $(SRC_PATH)/tests/fate/segafilm.mak
  199. include $(SRC_PATH)/tests/fate/segment.mak
  200. include $(SRC_PATH)/tests/fate/source.mak
  201. include $(SRC_PATH)/tests/fate/spdif.mak
  202. include $(SRC_PATH)/tests/fate/speedhq.mak
  203. include $(SRC_PATH)/tests/fate/subtitles.mak
  204. include $(SRC_PATH)/tests/fate/truehd.mak
  205. include $(SRC_PATH)/tests/fate/utvideo.mak
  206. include $(SRC_PATH)/tests/fate/vbn.mak
  207. include $(SRC_PATH)/tests/fate/video.mak
  208. include $(SRC_PATH)/tests/fate/voice.mak
  209. include $(SRC_PATH)/tests/fate/vorbis.mak
  210. include $(SRC_PATH)/tests/fate/vpx.mak
  211. include $(SRC_PATH)/tests/fate/vqf.mak
  212. include $(SRC_PATH)/tests/fate/vvc.mak
  213. include $(SRC_PATH)/tests/fate/wavpack.mak
  214. include $(SRC_PATH)/tests/fate/webm-dash-manifest.mak
  215. include $(SRC_PATH)/tests/fate/wma.mak
  216. include $(SRC_PATH)/tests/fate/xvid.mak
  217. FATE_FFMPEG += $(FATE_FFMPEG-yes) $(FATE_AVCONV) $(FATE_AVCONV-yes)
  218. FATE-$(CONFIG_FFMPEG) += $(FATE_FFMPEG)
  219. FATE-$(CONFIG_FFPROBE) += $(FATE_FFPROBE)
  220. FATE-$(call ALLYES, FFMPEG FFPROBE) += $(FATE_FFMPEG_FFPROBE)
  221. FATE_SAMPLES_AVCONV += $(FATE_SAMPLES_AVCONV-yes)
  222. FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_FFMPEG-yes)
  223. FATE_EXTERN-$(CONFIG_FFMPEG) += $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG)
  224. FATE_EXTERN-$(CONFIG_FFPROBE) += $(FATE_SAMPLES_FFPROBE)
  225. FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_SAMPLES_FFMPEG_FFPROBE-yes)
  226. FATE_EXTERN-$(call ALLYES, FFMPEG FFPROBE) += $(FATE_SAMPLES_FFMPEG_FFPROBE)
  227. FATE_EXTERN += $(FATE_EXTERN-yes) $(FATE_SAMPLES_FASTSTART)
  228. FATE += $(FATE-yes)
  229. RSYNC_OPTIONS-$(HAVE_RSYNC_CONTIMEOUT) += --contimeout=60
  230. RSYNC_OPTIONS = -vrltLW --timeout=60 $(RSYNC_OPTIONS-yes)
  231. $(FATE_FFMPEG) $(FATE_FFMPEG_FFPROBE) $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG) $(FATE_SAMPLES_FFMPEG_FFPROBE): ffmpeg$(PROGSSUF)$(EXESUF)
  232. $(FATE_FFPROBE) $(FATE_FFMPEG_FFPROBE) $(FATE_SAMPLES_FFPROBE) $(FATE_SAMPLES_FFMPEG_FFPROBE): ffprobe$(PROGSSUF)$(EXESUF)
  233. $(FATE_SAMPLES_FASTSTART): tools/qt-faststart$(EXESUF)
  234. $(FATE_SAMPLES_DUMP_DATA) $(FATE_SAMPLES_DUMP_DATA-yes): tools/venc_data_dump$(EXESUF)
  235. $(FATE_SAMPLES_SCALE_SLICE): tools/scale_slice_test$(EXESUF)
  236. ifdef SAMPLES
  237. FATE += $(FATE_EXTERN)
  238. fate-rsync:
  239. rsync $(RSYNC_OPTIONS) rsync://fate-suite.ffmpeg.org/fate-suite/ $(SAMPLES)
  240. else
  241. fate::
  242. @echo "warning: only a subset of the fate tests will be run because SAMPLES is not specified"
  243. fate-rsync:
  244. @echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
  245. $(FATE_EXTERN):
  246. @echo "$@ requires external samples and SAMPLES not specified"; false
  247. endif
  248. FATE_UTILS = base64 tiny_psnr tiny_ssim audiomatch
  249. TOOL = ffmpeg
  250. $(addprefix fate-, $(IGNORE_TESTS)): REPORT=ignore
  251. fate:: $(FATE)
  252. # Tests requiring hardware support are not included in a default fate run.
  253. fate-hw: $(FATE_HW-yes)
  254. FATE += $(FATE_HW-yes)
  255. $(FATE): export PROGSUF = $(PROGSSUF)
  256. $(FATE): export EXECSUF = $(EXESUF)
  257. $(FATE): export HOSTEXECSUF = $(HOSTEXESUF)
  258. $(FATE): $(FATE_UTILS:%=tests/%$(HOSTEXESUF)) | $(FATE_OUTDIRS)
  259. @echo "TEST $(@:fate-%=%)$(FATE_SUFFIX)"
  260. $(Q)$(SRC_PATH)/tests/fate-run.sh $@$(FATE_SUFFIX) "$(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_FILES)'
  261. fate-list:
  262. @printf '%s\n' $(sort $(FATE))
  263. coverage.info: TAG = LCOV
  264. coverage.info:
  265. $(M)lcov -q -d $(CURDIR) -b $(patsubst src%,./,$(SRC_LINK)) --capture | \
  266. sed "s,$(CURDIR)/\./,$(CURDIR)/," > $@.in
  267. $(M)lcov -q --remove $@.in "/usr*" > $@
  268. $(Q)$(RM) $@.in
  269. lcov: TAG = GENHTML
  270. lcov: coverage.info
  271. $(M)genhtml -q -o $(CURDIR)/lcov $<
  272. lcov-reset: TAG = LCOV
  273. lcov-reset:
  274. $(M)lcov -q -d $(CURDIR) --zerocounters
  275. $(Q)$(RM) -f coverage.info
  276. clean:: testclean
  277. testclean::
  278. $(RM) -r tests/vsynth1 tests/data tools/lavfi-showfiltfmts$(PROGSSUF)$(EXESUF)
  279. $(RM) $(CLEANSUFFIXES:%=tests/%)
  280. $(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
  281. $(RM) tests/pixfmts.mak tests/test_copy.ffmeta
  282. -include $(wildcard tests/*.d)
  283. include $(SRC_PATH)/tests/checkasm/Makefile
  284. .PHONY: fate* lcov lcov-reset
  285. .INTERMEDIATE: coverage.info