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