Merge commit 'cbcd497f384f0f8ef3f76f85b29b644b900d6b9f'
[ffmpeg.git] / tests / Makefile
1 FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
2
3 VREF = tests/vsynth1/00.pgm
4 AREF = tests/data/asynth1.sw
5
6
7 $(AREF): CMP=
8
9 ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
10         @echo
11         @echo "Unfortunately ffserver is broken and therefore its regression"
12         @echo "test fails randomly. Treat the results accordingly."
13         @echo
14         $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
15
16 OBJDIRS += tests/data tests/vsynth1
17
18 tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF) | tests/vsynth1
19         $(M)./$< 'tests/vsynth1/'
20
21 tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF) | tests/data
22         $(M)./$< $@
23
24 tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data
25         $(M)./$< $@ $(subst -, ,$*)
26
27 tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
28         $(M)$< $@
29
30 tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
31         $(M)$< $(SRC_PATH)/tests/lena.pnm $@
32
33 tests/data/ffprobe-test.nut: ffmpeg$(EXESUF) | tests/data
34         $(M)$(TARGET_EXEC) ./$< \
35         -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]" \
36         -f ffmetadata -i $(SRC_PATH)/tests/test.ffmeta \
37         -flags +bitexact -map 0:0 -map 0:1 -map 0:2 -map_metadata 1 \
38         -map_metadata:s:0 1:s:0 -map_metadata:s:1 1:s:1 \
39         -vcodec rawvideo -acodec pcm_s16le \
40         -y $@ 2>/dev/null
41
42 tests/data/%.sw tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm tests/data/%.nut: TAG = GEN
43
44 include $(SRC_PATH)/tests/fate/acodec.mak
45 include $(SRC_PATH)/tests/fate/vcodec.mak
46
47 include $(SRC_PATH)/tests/fate/aac.mak
48 include $(SRC_PATH)/tests/fate/ac3.mak
49 include $(SRC_PATH)/tests/fate/adpcm.mak
50 include $(SRC_PATH)/tests/fate/alac.mak
51 include $(SRC_PATH)/tests/fate/als.mak
52 include $(SRC_PATH)/tests/fate/amrnb.mak
53 include $(SRC_PATH)/tests/fate/amrwb.mak
54 include $(SRC_PATH)/tests/fate/atrac.mak
55 include $(SRC_PATH)/tests/fate/audio.mak
56 include $(SRC_PATH)/tests/fate/bmp.mak
57 include $(SRC_PATH)/tests/fate/cdxl.mak
58 include $(SRC_PATH)/tests/fate/cover-art.mak
59 include $(SRC_PATH)/tests/fate/dct.mak
60 include $(SRC_PATH)/tests/fate/demux.mak
61 include $(SRC_PATH)/tests/fate/dfa.mak
62 include $(SRC_PATH)/tests/fate/dpcm.mak
63 include $(SRC_PATH)/tests/fate/ea.mak
64 include $(SRC_PATH)/tests/fate/ffprobe.mak
65 include $(SRC_PATH)/tests/fate/filter.mak
66 include $(SRC_PATH)/tests/fate/flac.mak
67 include $(SRC_PATH)/tests/fate/fft.mak
68 include $(SRC_PATH)/tests/fate/h264.mak
69 include $(SRC_PATH)/tests/fate/image.mak
70 include $(SRC_PATH)/tests/fate/indeo.mak
71 include $(SRC_PATH)/tests/fate/libavcodec.mak
72 include $(SRC_PATH)/tests/fate/libavformat.mak
73 include $(SRC_PATH)/tests/fate/libavutil.mak
74 include $(SRC_PATH)/tests/fate/mapchan.mak
75 include $(SRC_PATH)/tests/fate/lossless-audio.mak
76 include $(SRC_PATH)/tests/fate/lossless-video.mak
77 include $(SRC_PATH)/tests/fate/microsoft.mak
78 include $(SRC_PATH)/tests/fate/mp3.mak
79 include $(SRC_PATH)/tests/fate/mpc.mak
80 include $(SRC_PATH)/tests/fate/options.mak
81 include $(SRC_PATH)/tests/fate/pcm.mak
82 include $(SRC_PATH)/tests/fate/probe.mak
83 include $(SRC_PATH)/tests/fate/prores.mak
84 include $(SRC_PATH)/tests/fate/qt.mak
85 include $(SRC_PATH)/tests/fate/qtrle.mak
86 include $(SRC_PATH)/tests/fate/real.mak
87 include $(SRC_PATH)/tests/fate/screen.mak
88 include $(SRC_PATH)/tests/fate/subtitles.mak
89 include $(SRC_PATH)/tests/fate/utvideo.mak
90 include $(SRC_PATH)/tests/fate/video.mak
91 include $(SRC_PATH)/tests/fate/voice.mak
92 include $(SRC_PATH)/tests/fate/vorbis.mak
93 include $(SRC_PATH)/tests/fate/vpx.mak
94 include $(SRC_PATH)/tests/fate/vqf.mak
95 include $(SRC_PATH)/tests/fate/wavpack.mak
96 include $(SRC_PATH)/tests/fate/wma.mak
97
98 FATE_LAVF_FATE = $(LAVF_FATE_TESTS:%=fate-lavf-fate-%)
99 FATE_LAVF    = $(LAVF_TESTS:%=fate-lavf-%)
100 FATE_LAVFI   = $(LAVFI_TESTS:%=fate-lavfi-%)
101 FATE_SEEK    = $(SEEK_TESTS:seek_%=fate-seek-%)
102
103 FATE_AVCONV += $(FATE_LAVF)                                             \
104                $(FATE_LAVFI)                                            \
105                $(FATE_SEEK)                                             \
106
107 FATE_FFMPEG += $(FATE_FFMPEG-yes) $(FATE_AVCONV) $(FATE_AVCONV-yes)
108 FATE-$(CONFIG_FFMPEG) += $(FATE_FFMPEG)
109 FATE-$(CONFIG_FFPROBE) += $(FATE_FFPROBE)
110
111 FATE-$(CONFIG_AVCODEC)  += $(FATE_LIBAVCODEC)
112 FATE-$(CONFIG_AVFORMAT) += $(FATE_LIBAVFORMAT)
113
114 FATE_EXTERN-$(CONFIG_FFMPEG) += $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG)
115 FATE_EXTERN += $(FATE_EXTERN-yes)
116
117 FATE += $(FATE-yes)
118 FATE += $(FATE_LIBAVUTIL)
119
120 $(FATE_FFMPEG) $(FATE_LAVF_FATE) $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG): ffmpeg$(EXESUF)
121
122 $(FATE_FFPROBE): ffprobe$(EXESUF)
123
124 $(FATE_LAVF):  $(AREF) $(VREF)
125 $(FATE_LAVFI): $(VREF) libavfilter/filtfmts-test$(EXESUF)
126 $(FATE_SEEK):  fate-acodec fate-vsynth2 fate-lavf libavformat/seek-test$(EXESUF)
127
128 $(FATE_LAVF_FATE): CMD = lavffatetest
129 $(FATE_LAVF):    CMD = lavftest
130 $(FATE_LAVFI):   CMD = lavfitest
131 $(FATE_SEEK):    CMD = seektest
132
133 fate-lavf-fate: $(FATE_LAVF_FATE)
134 fate-lavf:   $(FATE_LAVF)
135 fate-lavfi:  $(FATE_LAVFI)
136 fate-seek:   $(FATE_SEEK)
137
138 ifdef SAMPLES
139 FATE += $(FATE_LAVF_FATE)
140 FATE += $(FATE_FULL) $(FATE_FULL-yes)
141 FATE += $(FATE_EXTERN)
142 fate-rsync:
143         rsync -vaLW --timeout=60 --contimeout=60 rsync://fate-suite.ffmpeg.org/fate-suite/ $(SAMPLES)
144 else
145 fate::
146         @echo "warning: only a subset of the fate tests will be run because SAMPLES is not specified"
147 fate-rsync:
148         @echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
149 $(FATE_EXTERN):
150         @echo "$@ requires external samples and SAMPLES not specified"; false
151 endif
152
153 FATE_UTILS = base64 tiny_psnr
154
155 TOOL = ffmpeg
156
157 fate:: $(FATE)
158
159 $(FATE) $(FATE_TESTS-no): $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
160         @echo "TEST    $(@:fate-%=%)"
161         $(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)'
162
163 fate-list:
164         @printf '%s\n' $(sort $(FATE))
165
166 clean:: testclean
167
168 testclean:
169         $(RM) -r tests/vsynth1 tests/data tools/lavfi-showfiltfmts$(EXESUF)
170         $(RM) $(CLEANSUFFIXES:%=tests/%)
171         $(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
172
173 -include $(wildcard tests/*.d)
174
175 .PHONY: fate*