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