1THREADS = 1 2VREF = tests/vsynth1/00.pgm 3AREF = tests/data/asynth1.sw 4 5FATEW = 34 6FATEH = 34 7 8FFMPEG=ffmpeg$(PROGSSUF)$(EXESUF) 9 10$(AREF): CMP= 11 12APITESTSDIR := tests/api 13DNNTESTSDIR := tests/dnn 14FATE_OUTDIRS = tests/data tests/data/fate tests/data/filtergraphs tests/data/lavf tests/data/lavf-fate tests/data/pixfmt tests/vsynth1 $(APITESTSDIR) $(DNNTESTSDIR) 15OUTDIRS += $(FATE_OUTDIRS) 16 17$(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth1 18 $(M)./$< 'tests/vsynth1/' 19 20$(AREF): tests/audiogen$(HOSTEXESUF) | tests/data 21 $(M)./$< $@ 22 23tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data 24 $(M)./$< $@ $(subst -, ,$*) 25 26tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data 27 $(M)$< $@ 28 29tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data 30 $(M)$< $(SRC_PATH)/tests/reference.pnm $@ 31 32tests/data/vsynth_lena.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data 33 $(M)$< $(SAMPLES)/lena.pnm $@ 34 35tests/data/vsynth3.yuv: tests/videogen$(HOSTEXESUF) | tests/data 36 $(M)$< $@ $(FATEW) $(FATEH) 37 38tests/test_copy.ffmeta: TAG = COPY 39tests/test_copy.ffmeta: tests/data 40 $(M)cp -f $(SRC_PATH)/tests/test.ffmeta tests/test_copy.ffmeta 41 42tests/data/ffprobe-test.nut: ffmpeg$(PROGSSUF)$(EXESUF) tests/test_copy.ffmeta 43 $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \ 44 -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]" \ 45 -f ffmetadata -i $(TARGET_PATH)/tests/test_copy.ffmeta \ 46 -flags +bitexact -fflags +bitexact -map 0:0 -map 0:1 -map 0:2 -map_metadata 1 \ 47 -map_metadata:s:0 1:s:0 -map_metadata:s:1 1:s:1 \ 48 -vcodec rawvideo -acodec pcm_s16le \ 49 -y $(TARGET_PATH)/$@ 2>/dev/null 50 51tests/data/%.sw tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm tests/data/%.nut: TAG = GEN 52 53tests/data/filtergraphs/%: TAG = COPY 54tests/data/filtergraphs/%: $(SRC_PATH)/tests/filtergraphs/% | tests/data/filtergraphs 55 $(M)cp $< $@ 56 57RUNNING_FATE := $(filter check fate%,$(filter-out fate-rsync,$(MAKECMDGOALS))) 58 59# Check sanity of dependencies when running FATE tests. 60ifneq (,$(RUNNING_FATE)) 61CHKCFG = $(if $($(1))$(!$(1)),$($(1)), $(error No such config: $(1))) 62endif 63 64ALLYES = $(strip $(call XYES, $(1))) 65XYES = $(if $(strip $(1)), \ 66 $(if $(call CHKCFG,CONFIG_$(firstword $(1))), \ 67 $(call XYES, $(wordlist 2, $(words $(1)), $(1)))), \ 68 yes) 69 70ENCDEC = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \ 71 $(firstword $(2))_MUXER $(lastword $(2))_DEMUXER) 72 73ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \ 74 $(firstword $(2))_ENCODER $(lastword $(2))_DECODER \ 75 $(firstword $(3))_MUXER $(lastword $(3))_DEMUXER) 76 77DEMDEC = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER)) 78ENCMUX = $(call ALLYES, $(1:%=%_ENCODER) $(2)_MUXER) 79 80DEMMUX = $(call ALLYES, $(1)_DEMUXER $(2)_MUXER) 81 82FILTERDEMDEC = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER) 83FILTERDEMDECMUX = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_MUXER) 84FILTERDEMDECENCMUX = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_ENCODER $(5)_MUXER) 85 86PARSERDEMDEC = $(call ALLYES, $(1)_PARSER $(2)_DEMUXER $(3)_DECODER) 87 88# Allow overriding CONFIG_LARGE_TESTS via LARGE_TESTS, if set on the 89# make command line. 90ifeq ($(LARGE_TESTS), yes) 91CONFIG_LARGE_TESTS:=yes 92!CONFIG_LARGE_TESTS:= 93else ifeq ($(LARGE_TESTS), no) 94CONFIG_LARGE_TESTS:= 95!CONFIG_LARGE_TESTS:=yes 96endif 97 98include $(SRC_PATH)/$(APITESTSDIR)/Makefile 99include $(SRC_PATH)/$(DNNTESTSDIR)/Makefile 100 101include $(SRC_PATH)/tests/fate/acodec.mak 102include $(SRC_PATH)/tests/fate/vcodec.mak 103 104include $(SRC_PATH)/tests/fate/lavf-audio.mak 105include $(SRC_PATH)/tests/fate/lavf-container.mak 106include $(SRC_PATH)/tests/fate/lavf-image.mak 107include $(SRC_PATH)/tests/fate/lavf-image2pipe.mak 108include $(SRC_PATH)/tests/fate/lavf-video.mak 109include $(SRC_PATH)/tests/fate/seek.mak 110 111include $(SRC_PATH)/tests/fate/aac.mak 112include $(SRC_PATH)/tests/fate/ac3.mak 113include $(SRC_PATH)/tests/fate/adpcm.mak 114include $(SRC_PATH)/tests/fate/alac.mak 115include $(SRC_PATH)/tests/fate/als.mak 116include $(SRC_PATH)/tests/fate/amrnb.mak 117include $(SRC_PATH)/tests/fate/amrwb.mak 118include $(SRC_PATH)/tests/fate/api.mak 119include $(SRC_PATH)/tests/fate/apng.mak 120include $(SRC_PATH)/tests/fate/atrac.mak 121include $(SRC_PATH)/tests/fate/audio.mak 122include $(SRC_PATH)/tests/fate/bmp.mak 123include $(SRC_PATH)/tests/fate/build.mak 124include $(SRC_PATH)/tests/fate/canopus.mak 125include $(SRC_PATH)/tests/fate/cbs.mak 126include $(SRC_PATH)/tests/fate/cdxl.mak 127include $(SRC_PATH)/tests/fate/checkasm.mak 128include $(SRC_PATH)/tests/fate/concatdec.mak 129include $(SRC_PATH)/tests/fate/cover-art.mak 130include $(SRC_PATH)/tests/fate/dca.mak 131include $(SRC_PATH)/tests/fate/demux.mak 132include $(SRC_PATH)/tests/fate/dfa.mak 133include $(SRC_PATH)/tests/fate/dnn.mak 134include $(SRC_PATH)/tests/fate/dnxhd.mak 135include $(SRC_PATH)/tests/fate/dpcm.mak 136include $(SRC_PATH)/tests/fate/ea.mak 137include $(SRC_PATH)/tests/fate/exif.mak 138include $(SRC_PATH)/tests/fate/ffmpeg.mak 139include $(SRC_PATH)/tests/fate/ffprobe.mak 140include $(SRC_PATH)/tests/fate/fft.mak 141include $(SRC_PATH)/tests/fate/fifo-muxer.mak 142include $(SRC_PATH)/tests/fate/filter-audio.mak 143include $(SRC_PATH)/tests/fate/filter-video.mak 144include $(SRC_PATH)/tests/fate/fits.mak 145include $(SRC_PATH)/tests/fate/flac.mak 146include $(SRC_PATH)/tests/fate/flvenc.mak 147include $(SRC_PATH)/tests/fate/gapless.mak 148include $(SRC_PATH)/tests/fate/gif.mak 149include $(SRC_PATH)/tests/fate/h264.mak 150include $(SRC_PATH)/tests/fate/hap.mak 151include $(SRC_PATH)/tests/fate/hevc.mak 152include $(SRC_PATH)/tests/fate/hlsenc.mak 153include $(SRC_PATH)/tests/fate/hw.mak 154include $(SRC_PATH)/tests/fate/id3v2.mak 155include $(SRC_PATH)/tests/fate/image.mak 156include $(SRC_PATH)/tests/fate/indeo.mak 157include $(SRC_PATH)/tests/fate/libavcodec.mak 158include $(SRC_PATH)/tests/fate/libavdevice.mak 159include $(SRC_PATH)/tests/fate/libavformat.mak 160include $(SRC_PATH)/tests/fate/libavresample.mak 161include $(SRC_PATH)/tests/fate/libavutil.mak 162include $(SRC_PATH)/tests/fate/libswresample.mak 163include $(SRC_PATH)/tests/fate/libswscale.mak 164include $(SRC_PATH)/tests/fate/lossless-audio.mak 165include $(SRC_PATH)/tests/fate/lossless-video.mak 166include $(SRC_PATH)/tests/fate/matroska.mak 167include $(SRC_PATH)/tests/fate/microsoft.mak 168include $(SRC_PATH)/tests/fate/monkeysaudio.mak 169include $(SRC_PATH)/tests/fate/mov.mak 170include $(SRC_PATH)/tests/fate/mp3.mak 171include $(SRC_PATH)/tests/fate/mpc.mak 172include $(SRC_PATH)/tests/fate/mpeg4.mak 173include $(SRC_PATH)/tests/fate/mpegps.mak 174include $(SRC_PATH)/tests/fate/mpegts.mak 175include $(SRC_PATH)/tests/fate/mxf.mak 176include $(SRC_PATH)/tests/fate/opus.mak 177include $(SRC_PATH)/tests/fate/pcm.mak 178include $(SRC_PATH)/tests/fate/pixfmt.mak 179include $(SRC_PATH)/tests/fate/pixlet.mak 180include $(SRC_PATH)/tests/fate/probe.mak 181include $(SRC_PATH)/tests/fate/prores.mak 182include $(SRC_PATH)/tests/fate/qt.mak 183include $(SRC_PATH)/tests/fate/qtrle.mak 184include $(SRC_PATH)/tests/fate/real.mak 185include $(SRC_PATH)/tests/fate/screen.mak 186include $(SRC_PATH)/tests/fate/segment.mak 187include $(SRC_PATH)/tests/fate/source.mak 188include $(SRC_PATH)/tests/fate/speedhq.mak 189include $(SRC_PATH)/tests/fate/subtitles.mak 190include $(SRC_PATH)/tests/fate/truehd.mak 191include $(SRC_PATH)/tests/fate/utvideo.mak 192include $(SRC_PATH)/tests/fate/video.mak 193include $(SRC_PATH)/tests/fate/voice.mak 194include $(SRC_PATH)/tests/fate/vorbis.mak 195include $(SRC_PATH)/tests/fate/vpx.mak 196include $(SRC_PATH)/tests/fate/vqf.mak 197include $(SRC_PATH)/tests/fate/wavpack.mak 198include $(SRC_PATH)/tests/fate/wma.mak 199include $(SRC_PATH)/tests/fate/xvid.mak 200 201FATE_FFMPEG += $(FATE_FFMPEG-yes) $(FATE_AVCONV) $(FATE_AVCONV-yes) 202FATE-$(CONFIG_FFMPEG) += $(FATE_FFMPEG) 203FATE-$(CONFIG_FFPROBE) += $(FATE_FFPROBE) 204FATE-$(call ALLYES, FFMPEG FFPROBE) += $(FATE_FFMPEG_FFPROBE) 205 206FATE_SAMPLES_AVCONV += $(FATE_SAMPLES_AVCONV-yes) 207FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_FFMPEG-yes) 208FATE_EXTERN-$(CONFIG_FFMPEG) += $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG) 209FATE_EXTERN-$(CONFIG_FFPROBE) += $(FATE_SAMPLES_FFPROBE) 210FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_SAMPLES_FFMPEG_FFPROBE-yes) 211FATE_EXTERN-$(call ALLYES, FFMPEG FFPROBE) += $(FATE_SAMPLES_FFMPEG_FFPROBE) 212FATE_EXTERN += $(FATE_EXTERN-yes) $(FATE_SAMPLES_FASTSTART) 213 214FATE += $(FATE-yes) 215 216RSYNC_OPTIONS-$(HAVE_RSYNC_CONTIMEOUT) += --contimeout=60 217RSYNC_OPTIONS = -vrltLW --timeout=60 $(RSYNC_OPTIONS-yes) 218 219$(FATE_FFMPEG) $(FATE_FFMPEG_FFPROBE) $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG) $(FATE_SAMPLES_FFMPEG_FFPROBE): ffmpeg$(PROGSSUF)$(EXESUF) 220 221$(FATE_FFPROBE) $(FATE_FFMPEG_FFPROBE) $(FATE_SAMPLES_FFPROBE) $(FATE_SAMPLES_FFMPEG_FFPROBE): ffprobe$(PROGSSUF)$(EXESUF) 222 223$(FATE_SAMPLES_FASTSTART): tools/qt-faststart$(EXESUF) 224$(FATE_SAMPLES_DUMP_DATA): tools/venc_data_dump$(EXESUF) 225 226ifdef SAMPLES 227FATE += $(FATE_EXTERN) 228fate-rsync: 229 rsync $(RSYNC_OPTIONS) rsync://fate-suite.ffmpeg.org/fate-suite/ $(SAMPLES) 230else 231fate:: 232 @echo "warning: only a subset of the fate tests will be run because SAMPLES is not specified" 233fate-rsync: 234 @echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite" 235$(FATE_EXTERN): 236 @echo "$@ requires external samples and SAMPLES not specified"; false 237endif 238 239FATE_UTILS = base64 tiny_psnr tiny_ssim audiomatch 240 241TOOL = ffmpeg 242 243$(addprefix fate-, $(IGNORE_TESTS)): REPORT=ignore 244 245fate:: $(FATE) 246 247# Tests requiring hardware support are not included in a default fate run. 248fate-hw: $(FATE_HW-yes) 249FATE += $(FATE_HW-yes) 250 251$(FATE) $(FATE_TESTS-no): export PROGSUF = $(PROGSSUF) 252$(FATE) $(FATE_TESTS-no): export EXECSUF = $(EXESUF) 253$(FATE) $(FATE_TESTS-no): export HOSTEXECSUF = $(HOSTEXESUF) 254$(FATE) $(FATE_TESTS-no): $(FATE_UTILS:%=tests/%$(HOSTEXESUF)) | $(FATE_OUTDIRS) 255 @echo "TEST $(@:fate-%=%)" 256 $(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)' '$(HWACCEL)' '$(REPORT)' '$(KEEP)' 257 258fate-list: 259 @printf '%s\n' $(sort $(FATE)) 260 261coverage.info: TAG = LCOV 262coverage.info: 263 $(M)lcov -q -d $(CURDIR) -b $(patsubst src%,./,$(SRC_LINK)) --capture | \ 264 sed "s,$(CURDIR)/\./,$(CURDIR)/," > $@.in 265 $(M)lcov -q --remove $@.in "/usr*" > $@ 266 $(Q)$(RM) $@.in 267 268lcov: TAG = GENHTML 269lcov: coverage.info 270 $(M)genhtml -q -o $(CURDIR)/lcov $< 271 272lcov-reset: TAG = LCOV 273lcov-reset: 274 $(M)lcov -q -d $(CURDIR) --zerocounters 275 $(Q)$(RM) -f coverage.info 276 277clean:: testclean 278 279testclean:: 280 $(RM) -r tests/vsynth1 tests/data tools/lavfi-showfiltfmts$(PROGSSUF)$(EXESUF) 281 $(RM) $(CLEANSUFFIXES:%=tests/%) 282 $(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF)) 283 $(RM) tests/pixfmts.mak tests/test_copy.ffmeta 284 285-include $(wildcard tests/*.d) 286 287include $(SRC_PATH)/tests/checkasm/Makefile 288 289.PHONY: fate* lcov lcov-reset 290.INTERMEDIATE: coverage.info 291