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
9
10 ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
11         @echo
12         @echo "Unfortunately ffserver is broken and therefore its regression"
13         @echo "test fails randomly. Treat the results accordingly."
14         @echo
15         $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
16
17 tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
18         @mkdir -p tests/vsynth1
19         $(M)./$< 'tests/vsynth1/'
20
21 tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
22         @mkdir -p tests/vsynth2
23         $(M)./$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
24
25 tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
26         @mkdir -p tests/data
27         $(M)./$< $@
28
29 tests/data/asynth-16000-1.sw: tests/audiogen$(HOSTEXESUF)
30         @mkdir -p tests/data
31         $(M)./$< $@ 16000 1
32
33 tests/data/mapchan-6ch.sw: tests/audiogen$(HOSTEXESUF)
34         @mkdir -p tests/data
35         $(M)./$< $@ 22050 6
36
37 tests/data/mapchan-mono.sw: tests/audiogen$(HOSTEXESUF)
38         @mkdir -p tests/data
39         $(M)./$< $@ 22050 1
40
41 tests/data/asynth%.sw tests/vsynth%/00.pgm: TAG = GEN
42
43 include $(SRC_PATH)/tests/fate/aac.mak
44 include $(SRC_PATH)/tests/fate/ac3.mak
45 include $(SRC_PATH)/tests/fate/als.mak
46 include $(SRC_PATH)/tests/fate/amrnb.mak
47 include $(SRC_PATH)/tests/fate/amrwb.mak
48 include $(SRC_PATH)/tests/fate/atrac.mak
49 include $(SRC_PATH)/tests/fate/audio.mak
50 include $(SRC_PATH)/tests/fate/dct.mak
51 include $(SRC_PATH)/tests/fate/demux.mak
52 include $(SRC_PATH)/tests/fate/dpcm.mak
53 include $(SRC_PATH)/tests/fate/ea.mak
54 include $(SRC_PATH)/tests/fate/fft.mak
55 include $(SRC_PATH)/tests/fate/h264.mak
56 include $(SRC_PATH)/tests/fate/image.mak
57 include $(SRC_PATH)/tests/fate/indeo.mak
58 include $(SRC_PATH)/tests/fate/libavcodec.mak
59 include $(SRC_PATH)/tests/fate/libavutil.mak
60 include $(SRC_PATH)/tests/fate/mapchan.mak
61 include $(SRC_PATH)/tests/fate/lossless-audio.mak
62 include $(SRC_PATH)/tests/fate/lossless-video.mak
63 include $(SRC_PATH)/tests/fate/microsoft.mak
64 include $(SRC_PATH)/tests/fate/mp3.mak
65 include $(SRC_PATH)/tests/fate/mpc.mak
66 include $(SRC_PATH)/tests/fate/pcm.mak
67 include $(SRC_PATH)/tests/fate/prores.mak
68 include $(SRC_PATH)/tests/fate/qt.mak
69 include $(SRC_PATH)/tests/fate/qtrle.mak
70 include $(SRC_PATH)/tests/fate/real.mak
71 include $(SRC_PATH)/tests/fate/screen.mak
72 include $(SRC_PATH)/tests/fate/utvideo.mak
73 include $(SRC_PATH)/tests/fate/video.mak
74 include $(SRC_PATH)/tests/fate/voice.mak
75 include $(SRC_PATH)/tests/fate/vorbis.mak
76 include $(SRC_PATH)/tests/fate/vpx.mak
77 include $(SRC_PATH)/tests/fate/vqf.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    = $(LAVF_TESTS:%=fate-lavf-%)
85 FATE_LAVFI   = $(LAVFI_TESTS:%=fate-lavfi-%)
86 FATE_SEEK    = $(SEEK_TESTS:seek_%=fate-seek-%)
87
88 FATE = $(FATE_ACODEC)                                                   \
89        $(FATE_VCODEC)                                                   \
90        $(FATE_LAVF)                                                     \
91        $(FATE_SEEK)                                                     \
92
93 FATE-$(CONFIG_AVFILTER) += $(FATE_LAVFI)
94
95 FATE += $(FATE-yes)
96
97 $(filter-out %-aref,$(FATE_ACODEC)): $(AREF)
98 $(filter-out %-vref,$(FATE_VSYNTH1)): fate-vsynth1-vref
99 $(filter-out %-vref,$(FATE_VSYNTH2)): fate-vsynth2-vref
100 $(FATE_LAVF):   $(REFS)
101 $(FATE_LAVFI):  $(REFS) tools/lavfi-showfiltfmts$(EXESUF)
102 $(FATE_SEEK):   fate-codec fate-lavf libavformat/seek-test$(EXESUF)
103
104 $(FATE_ACODEC):  CMD = codectest acodec
105 $(FATE_VSYNTH1): CMD = codectest vsynth1
106 $(FATE_VSYNTH2): CMD = codectest vsynth2
107 $(FATE_LAVF):    CMD = lavftest
108 $(FATE_LAVFI):   CMD = lavfitest
109 $(FATE_SEEK):    CMD = seektest
110
111 fate-codec:  fate-acodec fate-vcodec
112 fate-acodec: $(FATE_ACODEC)
113 fate-vcodec: $(FATE_VCODEC)
114 fate-lavf:   $(FATE_LAVF)
115 fate-lavfi:  $(FATE_LAVFI)
116 fate-seek:   $(FATE_SEEK)
117
118 ifdef SAMPLES
119 FATE += $(FATE_TESTS) $(FATE_TESTS-yes)
120 fate-rsync:
121         rsync -vaLW --timeout=60 --contimeout=60 rsync://fate.ffmpeg.org/fate-suite/ $(SAMPLES)
122 else
123 fate::
124         @echo "warning: only a subset of the fate tests will be run because SAMPLES is not specified"
125 fate-rsync:
126         @echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
127 $(FATE_TESTS):
128         @echo "SAMPLES not specified, cannot run FATE"
129 endif
130
131 FATE_UTILS = base64 tiny_psnr
132
133 TOOL = ffmpeg
134
135 fate:: $(FATE)
136
137 $(FATE): $(TOOL)$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
138         @echo "TEST    $(@:fate-%=%)"
139         $(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)' '$(TOOL)'
140
141 fate-list:
142         @printf '%s\n' $(sort $(FATE))
143
144 clean:: testclean
145
146 testclean:
147         $(RM) -r tests/vsynth1 tests/vsynth2 tests/data tools/lavfi-showfiltfmts$(EXESUF)
148         $(RM) $(CLEANSUFFIXES:%=tests/%)
149         $(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
150
151 -include $(wildcard tests/*.d)
152
153 .PHONY: fate*