fate: Split fate-pixdesc tests and dispatch them through Make
[ffmpeg.git] / tests / Makefile
1 VREF = tests/vsynth1/00.pgm
2 AREF = tests/data/asynth1.sw
3
4 OBJDIRS += tests/data tests/vsynth1 tests/data/filtergraphs
5
6 $(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth1
7         $(M)./$< 'tests/vsynth1/'
8
9 $(AREF): tests/audiogen$(HOSTEXESUF) | tests/data
10         $(M)./$< $@
11
12 tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data
13         $(M)./$< $@ $(subst -, ,$*)
14
15 tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
16         $(M)$< $@
17
18 tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
19         $(M)$< $(SRC_PATH)/tests/lena.pnm $@
20
21 tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm: TAG = GEN
22
23 tests/data/filtergraphs/%: TAG = COPY
24 tests/data/filtergraphs/%: $(SRC_PATH)/tests/filtergraphs/% | tests/data/filtergraphs
25         $(M)cp $< $@
26
27 RUNNING_FATE := $(filter check fate%,$(filter-out fate-rsync,$(MAKECMDGOALS)))
28
29 # Check sanity of dependencies when running FATE tests.
30 ifneq (,$(RUNNING_FATE))
31 CHKCFG  = $(if $($(1))$(!$(1)),$($(1)), $(error No such config: $(1)))
32 endif
33
34 ALLYES  = $(strip $(call XYES, $(1)))
35 XYES    = $(if $(strip $(1)),                                           \
36                $(if $(call CHKCFG,CONFIG_$(firstword $(1))),            \
37                     $(call XYES, $(wordlist 2, $(words $(1)), $(1)))),  \
38                yes)
39
40 ENCDEC  = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
41                          $(firstword $(2))_MUXER   $(lastword $(2))_DEMUXER)
42
43 ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
44                          $(firstword $(2))_ENCODER $(lastword $(2))_DECODER  \
45                          $(firstword $(3))_MUXER   $(lastword $(3))_DEMUXER)
46
47 DEMDEC  = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER))
48 ENCMUX  = $(call ALLYES, $(1:%=%_ENCODER) $(2)_MUXER)
49
50 DEMMUX  = $(call ALLYES, $(1)_DEMUXER $(2)_MUXER)
51
52 FILTERDEMDEC       = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER)
53 FILTERDEMDECMUX    = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_MUXER)
54 FILTERDEMDECENCMUX = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_ENCODER $(5)_MUXER)
55
56 PARSERDEMDEC       = $(call ALLYES, $(1)_PARSER $(2)_DEMUXER $(3)_DECODER)
57
58 include $(SRC_PATH)/tests/fate/acodec.mak
59 include $(SRC_PATH)/tests/fate/vcodec.mak
60 include $(SRC_PATH)/tests/fate/avformat.mak
61 include $(SRC_PATH)/tests/fate/seek.mak
62
63 include $(SRC_PATH)/tests/fate/aac.mak
64 include $(SRC_PATH)/tests/fate/ac3.mak
65 include $(SRC_PATH)/tests/fate/adpcm.mak
66 include $(SRC_PATH)/tests/fate/alac.mak
67 include $(SRC_PATH)/tests/fate/als.mak
68 include $(SRC_PATH)/tests/fate/amrnb.mak
69 include $(SRC_PATH)/tests/fate/amrwb.mak
70 include $(SRC_PATH)/tests/fate/atrac.mak
71 include $(SRC_PATH)/tests/fate/audio.mak
72 include $(SRC_PATH)/tests/fate/bmp.mak
73 include $(SRC_PATH)/tests/fate/cdxl.mak
74 include $(SRC_PATH)/tests/fate/cover-art.mak
75 include $(SRC_PATH)/tests/fate/demux.mak
76 include $(SRC_PATH)/tests/fate/dfa.mak
77 include $(SRC_PATH)/tests/fate/dpcm.mak
78 include $(SRC_PATH)/tests/fate/ea.mak
79 include $(SRC_PATH)/tests/fate/filter-audio.mak
80 include $(SRC_PATH)/tests/fate/filter-video.mak
81 include $(SRC_PATH)/tests/fate/flac.mak
82 include $(SRC_PATH)/tests/fate/fft.mak
83 include $(SRC_PATH)/tests/fate/h264.mak
84 include $(SRC_PATH)/tests/fate/hevc.mak
85 include $(SRC_PATH)/tests/fate/image.mak
86 include $(SRC_PATH)/tests/fate/indeo.mak
87 include $(SRC_PATH)/tests/fate/libavcodec.mak
88 include $(SRC_PATH)/tests/fate/libavdevice.mak
89 include $(SRC_PATH)/tests/fate/libavformat.mak
90 include $(SRC_PATH)/tests/fate/libavresample.mak
91 include $(SRC_PATH)/tests/fate/libavutil.mak
92 include $(SRC_PATH)/tests/fate/lossless-audio.mak
93 include $(SRC_PATH)/tests/fate/lossless-video.mak
94 include $(SRC_PATH)/tests/fate/microsoft.mak
95 include $(SRC_PATH)/tests/fate/monkeysaudio.mak
96 include $(SRC_PATH)/tests/fate/mp3.mak
97 include $(SRC_PATH)/tests/fate/mpc.mak
98 include $(SRC_PATH)/tests/fate/opus.mak
99 include $(SRC_PATH)/tests/fate/pcm.mak
100 include $(SRC_PATH)/tests/fate/probe.mak
101 include $(SRC_PATH)/tests/fate/prores.mak
102 include $(SRC_PATH)/tests/fate/qt.mak
103 include $(SRC_PATH)/tests/fate/qtrle.mak
104 include $(SRC_PATH)/tests/fate/real.mak
105 include $(SRC_PATH)/tests/fate/screen.mak
106 include $(SRC_PATH)/tests/fate/utvideo.mak
107 include $(SRC_PATH)/tests/fate/video.mak
108 include $(SRC_PATH)/tests/fate/voice.mak
109 include $(SRC_PATH)/tests/fate/vorbis.mak
110 include $(SRC_PATH)/tests/fate/vpx.mak
111 include $(SRC_PATH)/tests/fate/vqf.mak
112 include $(SRC_PATH)/tests/fate/wavpack.mak
113 include $(SRC_PATH)/tests/fate/wma.mak
114 include $(SRC_PATH)/tests/fate/xvid.mak
115
116 FATE_AVCONV += $(FATE_AVCONV-yes)
117 FATE-$(CONFIG_AVCONV) += $(FATE_AVCONV)
118
119 FATE_SAMPLES_AVCONV           += $(FATE_SAMPLES_AVCONV-yes)
120 FATE_SAMPLES-$(CONFIG_AVCONV) += $(FATE_SAMPLES_AVCONV)
121 FATE_SAMPLES += $(FATE_SAMPLES-yes)
122
123 FATE += $(FATE-yes)
124
125 $(FATE_AVCONV) $(FATE_SAMPLES_AVCONV): avconv$(EXESUF)
126
127 ifdef SAMPLES
128 FATE += $(FATE_SAMPLES)
129 fate-rsync:
130         rsync -vaLW rsync://fate-suite.libav.org/fate-suite/ $(SAMPLES)
131 else
132 fate-rsync:
133         @echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
134 $(FATE_SAMPLES):
135         @echo "$@ requires external samples and SAMPLES not specified"; false
136 endif
137
138 FATE_UTILS = base64 tiny_psnr
139
140 fate: $(FATE)
141
142 $(FATE): $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
143         @echo "TEST    $(@:fate-%=%)"
144         $(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)'
145
146 fate-list:
147         @printf '%s\n' $(sort $(FATE))
148
149 coverage.info: TAG = LCOV
150 coverage.info:
151         $(M)lcov -q -d $(CURDIR) -b $(SRC_PATH) --capture | \
152             sed "s,$(CURDIR)/\./,$(CURDIR)/," > $@
153         $(M)lcov -q --remove $@ "/usr/include*" -o $@
154
155 lcov:  TAG = GENHTML
156 lcov: coverage.info
157         $(M)genhtml -q -o $(CURDIR)/lcov $<
158
159 lcov-reset: TAG = LCOV
160 lcov-reset:
161         $(M)lcov -d $(CURDIR) --zerocounters
162         $(Q)$(RM) -f coverage.info
163
164 clean:: testclean
165
166 testclean:
167         $(RM) -r tests/vsynth1 tests/data
168         $(RM) $(CLEANSUFFIXES:%=tests/%)
169         $(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
170         $(RM) tests/pixfmts.mak
171
172 -include $(wildcard tests/*.d)
173
174 .PHONY: fate* lcov lcov-reset
175 .INTERMEDIATE: coverage.info