fate: handle lavf test dependencies entirely in make
[ffmpeg.git] / tests / Makefile
1 VREF = tests/vsynth1/00.pgm
2 AREF = tests/data/asynth1.sw
3
4 OBJDIRS += tests/data tests/vsynth1
5
6 tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF) | tests/vsynth1
7         $(M)./$< 'tests/vsynth1/'
8
9 tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF) | tests/data
10         $(M)./$< $@
11
12 tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data
13         $(M)./$< $@ $(subst -, ,$*)
14
15 tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
16         $(M)$< $@
17
18 tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
19         $(M)$< $(SRC_PATH)/tests/lena.pnm $@
20
21 tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm: TAG = GEN
22
23 ALLYES  = $(strip $(call XYES, $(1)))
24 XYES    = $(if $(strip $(1)),                                           \
25                $(if $(CONFIG_$(firstword $(1))),                        \
26                     $(call XYES, $(wordlist 2, $(words $(1)), $(1)))),  \
27                yes)
28
29 ENCDEC  = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
30                          $(firstword $(2))_MUXER   $(lastword $(2))_DEMUXER)
31
32 ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
33                          $(firstword $(2))_ENCODER $(lastword $(2))_DECODER  \
34                          $(firstword $(3))_MUXER   $(lastword $(3))_DEMUXER)
35
36 include $(SRC_PATH)/tests/fate/acodec.mak
37 include $(SRC_PATH)/tests/fate/vcodec.mak
38 include $(SRC_PATH)/tests/fate/avformat.mak
39
40 include $(SRC_PATH)/tests/fate/aac.mak
41 include $(SRC_PATH)/tests/fate/ac3.mak
42 include $(SRC_PATH)/tests/fate/adpcm.mak
43 include $(SRC_PATH)/tests/fate/alac.mak
44 include $(SRC_PATH)/tests/fate/als.mak
45 include $(SRC_PATH)/tests/fate/amrnb.mak
46 include $(SRC_PATH)/tests/fate/amrwb.mak
47 include $(SRC_PATH)/tests/fate/atrac.mak
48 include $(SRC_PATH)/tests/fate/audio.mak
49 include $(SRC_PATH)/tests/fate/bmp.mak
50 include $(SRC_PATH)/tests/fate/cdxl.mak
51 include $(SRC_PATH)/tests/fate/cover-art.mak
52 include $(SRC_PATH)/tests/fate/dct.mak
53 include $(SRC_PATH)/tests/fate/demux.mak
54 include $(SRC_PATH)/tests/fate/dfa.mak
55 include $(SRC_PATH)/tests/fate/dpcm.mak
56 include $(SRC_PATH)/tests/fate/ea.mak
57 include $(SRC_PATH)/tests/fate/filter.mak
58 include $(SRC_PATH)/tests/fate/flac.mak
59 include $(SRC_PATH)/tests/fate/fft.mak
60 include $(SRC_PATH)/tests/fate/h264.mak
61 include $(SRC_PATH)/tests/fate/image.mak
62 include $(SRC_PATH)/tests/fate/indeo.mak
63 include $(SRC_PATH)/tests/fate/libavcodec.mak
64 include $(SRC_PATH)/tests/fate/libavformat.mak
65 include $(SRC_PATH)/tests/fate/libavutil.mak
66 include $(SRC_PATH)/tests/fate/lossless-audio.mak
67 include $(SRC_PATH)/tests/fate/lossless-video.mak
68 include $(SRC_PATH)/tests/fate/microsoft.mak
69 include $(SRC_PATH)/tests/fate/mp3.mak
70 include $(SRC_PATH)/tests/fate/mpc.mak
71 include $(SRC_PATH)/tests/fate/pcm.mak
72 include $(SRC_PATH)/tests/fate/probe.mak
73 include $(SRC_PATH)/tests/fate/prores.mak
74 include $(SRC_PATH)/tests/fate/qt.mak
75 include $(SRC_PATH)/tests/fate/qtrle.mak
76 include $(SRC_PATH)/tests/fate/real.mak
77 include $(SRC_PATH)/tests/fate/screen.mak
78 include $(SRC_PATH)/tests/fate/utvideo.mak
79 include $(SRC_PATH)/tests/fate/video.mak
80 include $(SRC_PATH)/tests/fate/voice.mak
81 include $(SRC_PATH)/tests/fate/vorbis.mak
82 include $(SRC_PATH)/tests/fate/vpx.mak
83 include $(SRC_PATH)/tests/fate/vqf.mak
84 include $(SRC_PATH)/tests/fate/wavpack.mak
85 include $(SRC_PATH)/tests/fate/wma.mak
86
87 FATE_LAVFI   = $(LAVFI_TESTS:%=fate-lavfi-%)
88 FATE_SEEK    = $(SEEK_TESTS:seek_%=fate-seek-%)
89
90 FATE_AVCONV += $(FATE_LAVFI)                                            \
91                $(FATE_SEEK)                                             \
92
93 FATE_AVCONV += $(FATE_AVCONV-yes)
94 FATE-$(CONFIG_AVCONV) += $(FATE_AVCONV)
95
96 FATE-$(CONFIG_AVCODEC)  += $(FATE_LIBAVCODEC)
97 FATE-$(CONFIG_AVFORMAT) += $(FATE_LIBAVFORMAT)
98
99 FATE_SAMPLES-$(CONFIG_AVCONV) += $(FATE_SAMPLES_AVCONV)
100 FATE_SAMPLES += $(FATE_SAMPLES-yes)
101
102 FATE += $(FATE-yes)
103 FATE += $(FATE_LIBAVUTIL)
104
105 $(FATE_AVCONV) $(FATE_SAMPLES_AVCONV): avconv$(EXESUF)
106
107 $(FATE_LAVFI): $(VREF) libavfilter/filtfmts-test$(EXESUF)
108 $(FATE_SEEK):  fate-acodec fate-vsynth2 fate-lavf libavformat/seek-test$(EXESUF)
109
110 $(FATE_LAVFI):   CMD = lavfitest
111 $(FATE_SEEK):    CMD = seektest
112
113 fate-lavfi:  $(FATE_LAVFI)
114 fate-seek:   $(FATE_SEEK)
115
116 ifdef SAMPLES
117 FATE += $(FATE_SAMPLES)
118 fate-rsync:
119         rsync -vaLW rsync://fate-suite.libav.org/fate-suite/ $(SAMPLES)
120 else
121 fate-rsync:
122         @echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
123 $(FATE_SAMPLES):
124         @echo "$@ requires external samples and SAMPLES not specified"; false
125 endif
126
127 FATE_UTILS = base64 tiny_psnr
128
129 fate: $(FATE)
130
131 $(FATE): $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
132         @echo "TEST    $(@:fate-%=%)"
133         $(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)'
134
135 fate-list:
136         @printf '%s\n' $(sort $(FATE))
137
138 clean:: testclean
139
140 testclean:
141         $(RM) -r tests/vsynth1 tests/data
142         $(RM) $(CLEANSUFFIXES:%=tests/%)
143         $(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
144
145 -include $(wildcard tests/*.d)
146
147 .PHONY: fate*