Makefile 7.86 KB
Newer Older
1 2
FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref

3
THREADS = 1
4 5
VREF = tests/vsynth1/00.pgm
AREF = tests/data/asynth1.sw
6

7 8
FATEW = 34
FATEH = 34
9

10
$(AREF): CMP=
11 12 13 14 15 16 17 18

ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
	@echo
	@echo "Unfortunately ffserver is broken and therefore its regression"
	@echo "test fails randomly. Treat the results accordingly."
	@echo
	$(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf

19
OBJDIRS += tests/data tests/vsynth1 tests/data/filtergraphs
20

21
$(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth1
22 23
	$(M)./$< 'tests/vsynth1/'

24
$(AREF): tests/audiogen$(HOSTEXESUF) | tests/data
25 26
	$(M)./$< $@

27 28 29
tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data
	$(M)./$< $@ $(subst -, ,$*)

30
tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
31
	$(M)$< $@
32 33

tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
34
	$(M)$< $(SRC_PATH)/tests/lena.pnm $@
35

36 37 38
tests/data/vsynth3.yuv: tests/videogen$(HOSTEXESUF) | tests/data
	$(M)$< $@ $(FATEW) $(FATEH)

39
tests/data/ffprobe-test.nut: ffmpeg$(EXESUF) | tests/data
40
	$(M)$(TARGET_EXEC) ./$< \
41
        -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]" \
42 43
        -f ffmetadata -i $(SRC_PATH)/tests/test.ffmeta \
        -flags +bitexact -map 0:0 -map 0:1 -map 0:2 -map_metadata 1 \
44
        -map_metadata:s:0 1:s:0 -map_metadata:s:1 1:s:1 \
45 46 47 48
        -vcodec rawvideo -acodec pcm_s16le \
        -y $@ 2>/dev/null

tests/data/%.sw tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm tests/data/%.nut: TAG = GEN
49

50 51 52 53
tests/data/filtergraphs/%: TAG = COPY
tests/data/filtergraphs/%: $(SRC_PATH)/tests/filtergraphs/% | tests/data/filtergraphs
	$(M)cp $< $@

54 55
RUNNING_FATE := $(filter check fate%,$(filter-out fate-rsync,$(MAKECMDGOALS)))

56
# Check sanity of dependencies when running FATE tests.
57
ifneq (,$(RUNNING_FATE))
58
CHKCFG  = $(if $($(1))$(!$(1)),$($(1)), $(error No such config: $(1)))
59
endif
60

61 62
ALLYES  = $(strip $(call XYES, $(1)))
XYES    = $(if $(strip $(1)),                                           \
63
               $(if $(call CHKCFG,CONFIG_$(firstword $(1))),            \
64 65 66 67 68 69 70 71 72 73
                    $(call XYES, $(wordlist 2, $(words $(1)), $(1)))),  \
               yes)

ENCDEC  = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
                         $(firstword $(2))_MUXER   $(lastword $(2))_DEMUXER)

ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
                         $(firstword $(2))_ENCODER $(lastword $(2))_DECODER  \
                         $(firstword $(3))_MUXER   $(lastword $(3))_DEMUXER)

74
DEMDEC  = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER))
Mans Rullgard's avatar
Mans Rullgard committed
75
ENCMUX  = $(call ALLYES, $(1:%=%_ENCODER) $(2)_MUXER)
76

77 78
DEMMUX  = $(call ALLYES, $(1)_DEMUXER $(2)_MUXER)

79 80 81
FILTERDEMDEC       = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER)
FILTERDEMDECMUX    = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_MUXER)
FILTERDEMDECENCMUX = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_ENCODER $(5)_MUXER)
82

83 84
PARSERDEMDEC       = $(call ALLYES, $(1)_PARSER $(2)_DEMUXER $(3)_DECODER)

85 86
include $(SRC_PATH)/tests/fate/acodec.mak
include $(SRC_PATH)/tests/fate/vcodec.mak
87
include $(SRC_PATH)/tests/fate/avformat.mak
88
include $(SRC_PATH)/tests/fate/seek.mak
89

90
include $(SRC_PATH)/tests/fate/aac.mak
91
include $(SRC_PATH)/tests/fate/ac3.mak
92
include $(SRC_PATH)/tests/fate/adpcm.mak
93
include $(SRC_PATH)/tests/fate/alac.mak
94
include $(SRC_PATH)/tests/fate/als.mak
95 96
include $(SRC_PATH)/tests/fate/amrnb.mak
include $(SRC_PATH)/tests/fate/amrwb.mak
97
include $(SRC_PATH)/tests/fate/atrac.mak
98
include $(SRC_PATH)/tests/fate/audio.mak
Ronald S. Bultje's avatar
Ronald S. Bultje committed
99
include $(SRC_PATH)/tests/fate/bmp.mak
100
include $(SRC_PATH)/tests/fate/cdxl.mak
101
include $(SRC_PATH)/tests/fate/cover-art.mak
102
include $(SRC_PATH)/tests/fate/demux.mak
Oana Stratulat's avatar
Oana Stratulat committed
103
include $(SRC_PATH)/tests/fate/dfa.mak
104
include $(SRC_PATH)/tests/fate/dpcm.mak
105
include $(SRC_PATH)/tests/fate/ea.mak
Thilo Borgmann's avatar
Thilo Borgmann committed
106
include $(SRC_PATH)/tests/fate/exif.mak
107
include $(SRC_PATH)/tests/fate/ffmpeg.mak
108
include $(SRC_PATH)/tests/fate/ffprobe.mak
109
include $(SRC_PATH)/tests/fate/filter-audio.mak
110
include $(SRC_PATH)/tests/fate/filter-video.mak
111
include $(SRC_PATH)/tests/fate/flac.mak
112
include $(SRC_PATH)/tests/fate/fft.mak
113
include $(SRC_PATH)/tests/fate/gif.mak
114
include $(SRC_PATH)/tests/fate/h264.mak
Guillaume Martres's avatar
Guillaume Martres committed
115
include $(SRC_PATH)/tests/fate/hevc.mak
116
include $(SRC_PATH)/tests/fate/image.mak
117
include $(SRC_PATH)/tests/fate/indeo.mak
118
include $(SRC_PATH)/tests/fate/libavcodec.mak
119
include $(SRC_PATH)/tests/fate/libavdevice.mak
120
include $(SRC_PATH)/tests/fate/libavformat.mak
121
include $(SRC_PATH)/tests/fate/libavresample.mak
122
include $(SRC_PATH)/tests/fate/libavutil.mak
123
include $(SRC_PATH)/tests/fate/libswresample.mak
124 125
include $(SRC_PATH)/tests/fate/lossless-audio.mak
include $(SRC_PATH)/tests/fate/lossless-video.mak
126
include $(SRC_PATH)/tests/fate/microsoft.mak
127
include $(SRC_PATH)/tests/fate/monkeysaudio.mak
128
include $(SRC_PATH)/tests/fate/mp3.mak
129
include $(SRC_PATH)/tests/fate/mpc.mak
130
include $(SRC_PATH)/tests/fate/opus.mak
131
include $(SRC_PATH)/tests/fate/pcm.mak
132
include $(SRC_PATH)/tests/fate/probe.mak
133
include $(SRC_PATH)/tests/fate/prores.mak
134
include $(SRC_PATH)/tests/fate/qt.mak
135
include $(SRC_PATH)/tests/fate/qtrle.mak
136
include $(SRC_PATH)/tests/fate/real.mak
137
include $(SRC_PATH)/tests/fate/screen.mak
138
include $(SRC_PATH)/tests/fate/subtitles.mak
139
include $(SRC_PATH)/tests/fate/utvideo.mak
140
include $(SRC_PATH)/tests/fate/video.mak
141
include $(SRC_PATH)/tests/fate/voice.mak
142
include $(SRC_PATH)/tests/fate/vorbis.mak
143
include $(SRC_PATH)/tests/fate/vpx.mak
144
include $(SRC_PATH)/tests/fate/vqf.mak
145
include $(SRC_PATH)/tests/fate/wavpack.mak
146
include $(SRC_PATH)/tests/fate/wma.mak
147
include $(SRC_PATH)/tests/fate/xvid.mak
148

149
FATE_FFMPEG += $(FATE_FFMPEG-yes) $(FATE_AVCONV) $(FATE_AVCONV-yes)
150
FATE-$(CONFIG_FFMPEG) += $(FATE_FFMPEG)
151
FATE-$(CONFIG_FFPROBE) += $(FATE_FFPROBE)
152

153
FATE_SAMPLES_AVCONV           += $(FATE_SAMPLES_AVCONV-yes)
154
FATE_SAMPLES_FFMPEG           += $(FATE_SAMPLES_FFMPEG-yes)
155
FATE_EXTERN-$(CONFIG_FFMPEG)  += $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG) $(FATE_SAMPLES_FFPROBE)
156
FATE_EXTERN += $(FATE_EXTERN-yes)
157

158
FATE += $(FATE-yes)
159

160 161 162
RSYNC_OPTIONS-$(HAVE_RSYNC_CONTIMEOUT) += --contimeout=60
RSYNC_OPTIONS = -vrltLW --timeout=60 $(RSYNC_OPTIONS-yes)

163
$(FATE_FFMPEG) $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG): ffmpeg$(EXESUF)
164

165
$(FATE_FFPROBE) $(FATE_SAMPLES_FFPROBE): ffprobe$(EXESUF)
166

167
ifdef SAMPLES
168
FATE += $(FATE_FULL) $(FATE_FULL-yes)
169
FATE += $(FATE_EXTERN)
170
fate-rsync:
171
	rsync $(RSYNC_OPTIONS) rsync://fate-suite.ffmpeg.org/fate-suite/ $(SAMPLES)
172
else
173 174
fate::
	@echo "warning: only a subset of the fate tests will be run because SAMPLES is not specified"
175 176
fate-rsync:
	@echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
177
$(FATE_EXTERN):
178
	@echo "$@ requires external samples and SAMPLES not specified"; false
179 180
endif

Loren Merritt's avatar
Loren Merritt committed
181
FATE_UTILS = base64 tiny_psnr tiny_ssim
182

183
TOOL = ffmpeg
184

185
fate:: $(FATE)
186

187
$(FATE) $(FATE_TESTS-no): $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
188
	@echo "TEST    $(@:fate-%=%)"
189
	$(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)'
190 191 192 193

fate-list:
	@printf '%s\n' $(sort $(FATE))

194 195
coverage.info: TAG = LCOV
coverage.info:
196 197
	$(M)lcov -q -d $(CURDIR) -b $(SRC_PATH) --capture | \
	    sed "s,$(CURDIR)/\./,$(CURDIR)/," > $@
198
	$(M)lcov -q --remove $@ "/usr*" -o $@
199 200 201

lcov:  TAG = GENHTML
lcov: coverage.info
202
	$(M)genhtml -q -o $(CURDIR)/lcov $<
203 204 205 206 207 208

lcov-reset: TAG = LCOV
lcov-reset:
	$(M)lcov -d $(CURDIR) --zerocounters
	$(Q)$(RM) -f coverage.info

209 210 211
clean:: testclean

testclean:
212
	$(RM) -r tests/vsynth1 tests/data tools/lavfi-showfiltfmts$(EXESUF)
213
	$(RM) $(CLEANSUFFIXES:%=tests/%)
214
	$(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
215
	$(RM) tests/pixfmts.mak
216 217 218

-include $(wildcard tests/*.d)

219 220
.PHONY: fate* lcov lcov-reset
.INTERMEDIATE: coverage.info