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