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