fate: move amr[nw]b test rules into separate files
[ffmpeg.git] / tests / Makefile
1 fulltest test: codectest lavftest lavfitest seektest
2
3 FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
4
5 codectest: fate-codec
6 lavftest:  fate-lavf
7 lavfitest: fate-lavfi
8 seektest:  fate-seek
9
10 AREF = fate-acodec-aref
11 VREF = fate-vsynth1-vref fate-vsynth2-vref
12 REFS = $(AREF) $(VREF)
13
14 $(VREF): ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm
15 $(AREF): ffmpeg$(EXESUF) tests/data/asynth1.sw
16
17 ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
18         @echo
19         @echo "Unfortunately ffserver is broken and therefore its regression"
20         @echo "test fails randomly. Treat the results accordingly."
21         @echo
22         $(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
23
24 tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
25         @mkdir -p tests/vsynth1
26         $(M)./$< 'tests/vsynth1/'
27
28 tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
29         @mkdir -p tests/vsynth2
30         $(M)./$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
31
32 tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
33         @mkdir -p tests/data
34         $(M)./$< $@
35
36 tests/data/asynth1.sw tests/vsynth%/00.pgm: TAG = GEN
37
38 tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
39         $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
40
41 tools/lavfi-showfiltfmts$(EXESUF): tools/lavfi-showfiltfmts.o $(FF_DEP_LIBS)
42         $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
43
44 include $(SRC_PATH)/tests/fate.mak
45 include $(SRC_PATH)/tests/fate2.mak
46
47 include $(SRC_PATH)/tests/fate/aac.mak
48 include $(SRC_PATH)/tests/fate/als.mak
49 include $(SRC_PATH)/tests/fate/amrnb.mak
50 include $(SRC_PATH)/tests/fate/amrwb.mak
51 include $(SRC_PATH)/tests/fate/fft.mak
52 include $(SRC_PATH)/tests/fate/h264.mak
53 include $(SRC_PATH)/tests/fate/mp3.mak
54 include $(SRC_PATH)/tests/fate/vorbis.mak
55 include $(SRC_PATH)/tests/fate/vp8.mak
56
57 FATE_ACODEC  = $(ACODEC_TESTS:%=fate-acodec-%)
58 FATE_VSYNTH1 = $(VCODEC_TESTS:%=fate-vsynth1-%)
59 FATE_VSYNTH2 = $(VCODEC_TESTS:%=fate-vsynth2-%)
60 FATE_VCODEC  = $(FATE_VSYNTH1) $(FATE_VSYNTH2)
61 FATE_LAVF    = $(LAVF_TESTS:%=fate-lavf-%)
62 FATE_LAVFI   = $(LAVFI_TESTS:%=fate-lavfi-%)
63 FATE_SEEK    = $(SEEK_TESTS:seek_%=fate-seek-%)
64
65 FATE = $(FATE_ACODEC)                                                   \
66        $(FATE_VCODEC)                                                   \
67        $(FATE_LAVF)                                                     \
68        $(FATE_LAVFI)                                                    \
69        $(FATE_SEEK)                                                     \
70
71 $(filter-out %-aref,$(FATE_ACODEC)): $(AREF)
72 $(filter-out %-vref,$(FATE_VCODEC)): $(VREF)
73 $(FATE_LAVF):   $(REFS)
74 $(FATE_LAVFI):  $(REFS) tools/lavfi-showfiltfmts$(EXESUF)
75 $(FATE_SEEK):   fate-codec fate-lavf tests/seek_test$(EXESUF)
76
77 $(FATE_ACODEC):  CMD = codectest acodec
78 $(FATE_VSYNTH1): CMD = codectest vsynth1
79 $(FATE_VSYNTH2): CMD = codectest vsynth2
80 $(FATE_LAVF):    CMD = lavftest
81 $(FATE_LAVFI):   CMD = lavfitest
82 $(FATE_SEEK):    CMD = seektest
83
84 fate-codec:  fate-acodec fate-vcodec
85 fate-acodec: $(FATE_ACODEC)
86 fate-vcodec: $(FATE_VCODEC)
87 fate-lavf:   $(FATE_LAVF)
88 fate-lavfi:  $(FATE_LAVFI)
89 fate-seek:   $(FATE_SEEK)
90
91 ifdef SAMPLES
92 FATE += $(FATE_TESTS)
93 fate-rsync:
94         rsync -vaLW rsync://fate-suite.libav.org/fate-suite/ $(SAMPLES)
95 else
96 fate-rsync:
97         @echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
98 $(FATE_TESTS):
99         @echo "SAMPLES not specified, cannot run FATE"
100 endif
101
102 FATE_UTILS = base64 tiny_psnr
103
104 fate: $(FATE)
105
106 $(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
107         @echo "TEST    $(@:fate-%=%)"
108         $(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)'
109
110 fate-list:
111         @printf '%s\n' $(sort $(FATE))
112
113 clean:: testclean
114
115 testclean:
116         $(RM) -r tests/vsynth1 tests/vsynth2 tests/data
117         $(RM) $(CLEANSUFFIXES:%=tests/%)
118         $(RM) tests/seek_test$(EXESUF) tests/seek_test.o
119         $(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
120
121 -include $(wildcard tests/*.d)
122
123 .PHONY: fate* *test