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