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