build: move test rules to tests/Makefile
[libav.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_BARE)/tests/fate.mak
45 include $(SRC_PATH_BARE)/tests/fate2.mak
46
47 include $(SRC_PATH_BARE)/tests/fate/aac.mak
48 include $(SRC_PATH_BARE)/tests/fate/als.mak
49 include $(SRC_PATH_BARE)/tests/fate/fft.mak
50 include $(SRC_PATH_BARE)/tests/fate/h264.mak
51 include $(SRC_PATH_BARE)/tests/fate/mp3.mak
52 include $(SRC_PATH_BARE)/tests/fate/vorbis.mak
53 include $(SRC_PATH_BARE)/tests/fate/vp8.mak
54
55 FATE_ACODEC = $(ACODEC_TESTS:%=fate-acodec-%)
56 FATE_VSYNTH1 = $(VCODEC_TESTS:%=fate-vsynth1-%)
57 FATE_VSYNTH2 = $(VCODEC_TESTS:%=fate-vsynth2-%)
58 FATE_VCODEC = $(FATE_VSYNTH1) $(FATE_VSYNTH2)
59 FATE_LAVF = $(LAVF_TESTS:%=fate-lavf-%)
60 FATE_LAVFI = $(LAVFI_TESTS:%=fate-lavfi-%)
61 FATE_SEEK = $(SEEK_TESTS:seek_%=fate-seek-%)
62
63 FATE = $(FATE_ACODEC) \
64 $(FATE_VCODEC) \
65 $(FATE_LAVF) \
66 $(FATE_LAVFI) \
67 $(FATE_SEEK) \
68
69 $(filter-out %-aref,$(FATE_ACODEC)): $(AREF)
70 $(filter-out %-vref,$(FATE_VCODEC)): $(VREF)
71 $(FATE_LAVF): $(REFS)
72 $(FATE_LAVFI): $(REFS) tools/lavfi-showfiltfmts$(EXESUF)
73 $(FATE_SEEK): fate-codec fate-lavf tests/seek_test$(EXESUF)
74
75 $(FATE_ACODEC): CMD = codectest acodec
76 $(FATE_VSYNTH1): CMD = codectest vsynth1
77 $(FATE_VSYNTH2): CMD = codectest vsynth2
78 $(FATE_LAVF): CMD = lavftest
79 $(FATE_LAVFI): CMD = lavfitest
80 $(FATE_SEEK): CMD = seektest
81
82 fate-codec: fate-acodec fate-vcodec
83 fate-acodec: $(FATE_ACODEC)
84 fate-vcodec: $(FATE_VCODEC)
85 fate-lavf: $(FATE_LAVF)
86 fate-lavfi: $(FATE_LAVFI)
87 fate-seek: $(FATE_SEEK)
88
89 ifdef SAMPLES
90 FATE += $(FATE_TESTS)
91 fate-rsync:
92 rsync -vaLW rsync://fate-suite.libav.org/fate-suite/ $(SAMPLES)
93 else
94 fate-rsync:
95 @echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
96 $(FATE_TESTS):
97 @echo "SAMPLES not specified, cannot run FATE"
98 endif
99
100 FATE_UTILS = base64 tiny_psnr
101
102 fate: $(FATE)
103
104 $(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
105 @echo "TEST $(@:fate-%=%)"
106 $(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)'
107
108 fate-list:
109 @printf '%s\n' $(sort $(FATE))
110
111 clean:: testclean
112
113 testclean:
114 $(RM) -r tests/vsynth1 tests/vsynth2 tests/data
115 $(RM) $(addprefix tests/,$(CLEANSUFFIXES))
116 $(RM) tests/seek_test$(EXESUF) tests/seek_test.o
117 $(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
118
119 -include $(wildcard tests/*.d)
120
121 .PHONY: fate* *test