Makefile 6.18 KB
Newer Older
1
THREADS = 1
2 3
VREF = tests/vsynth1/00.pgm
AREF = tests/data/asynth1.sw
4

5
OBJDIRS += tests/data tests/vsynth1 tests/data/filtergraphs
6

7
$(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth1
8 9
	$(M)./$< 'tests/vsynth1/'

10
$(AREF): tests/audiogen$(HOSTEXESUF) | tests/data
11 12
	$(M)./$< $@

13 14 15
tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data
	$(M)./$< $@ $(subst -, ,$*)

16
tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
17
	$(M)$< $@
18 19

tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
Reinhard Tartler's avatar
Reinhard Tartler committed
20
	$(M)$< $(SRC_PATH)/tests/reference.pnm $@
21 22 23

tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm: TAG = GEN

24 25 26 27
tests/data/filtergraphs/%: TAG = COPY
tests/data/filtergraphs/%: $(SRC_PATH)/tests/filtergraphs/% | tests/data/filtergraphs
	$(M)cp $< $@

28 29
RUNNING_FATE := $(filter check fate%,$(filter-out fate-rsync,$(MAKECMDGOALS)))

30
# Check sanity of dependencies when running FATE tests.
31
ifneq (,$(RUNNING_FATE))
32
CHKCFG  = $(if $($(1))$(!$(1)),$($(1)), $(error No such config: $(1)))
33
endif
34

35 36
ALLYES  = $(strip $(call XYES, $(1)))
XYES    = $(if $(strip $(1)),                                           \
37
               $(if $(call CHKCFG,CONFIG_$(firstword $(1))),            \
38 39 40 41 42 43 44 45 46 47
                    $(call XYES, $(wordlist 2, $(words $(1)), $(1)))),  \
               yes)

ENCDEC  = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
                         $(firstword $(2))_MUXER   $(lastword $(2))_DEMUXER)

ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
                         $(firstword $(2))_ENCODER $(lastword $(2))_DECODER  \
                         $(firstword $(3))_MUXER   $(lastword $(3))_DEMUXER)

48
DEMDEC  = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER))
Mans Rullgard's avatar
Mans Rullgard committed
49
ENCMUX  = $(call ALLYES, $(1:%=%_ENCODER) $(2)_MUXER)
50

51 52
DEMMUX  = $(call ALLYES, $(1)_DEMUXER $(2)_MUXER)

53 54 55
FILTERDEMDEC       = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER)
FILTERDEMDECMUX    = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_MUXER)
FILTERDEMDECENCMUX = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_ENCODER $(5)_MUXER)
56

57 58
PARSERDEMDEC       = $(call ALLYES, $(1)_PARSER $(2)_DEMUXER $(3)_DECODER)

59 60
include $(SRC_PATH)/tests/fate/acodec.mak
include $(SRC_PATH)/tests/fate/vcodec.mak
61
include $(SRC_PATH)/tests/fate/avformat.mak
62
include $(SRC_PATH)/tests/fate/seek.mak
63

64
include $(SRC_PATH)/tests/fate/aac.mak
65
include $(SRC_PATH)/tests/fate/ac3.mak
66
include $(SRC_PATH)/tests/fate/adpcm.mak
67
include $(SRC_PATH)/tests/fate/alac.mak
68
include $(SRC_PATH)/tests/fate/als.mak
69 70
include $(SRC_PATH)/tests/fate/amrnb.mak
include $(SRC_PATH)/tests/fate/amrwb.mak
71
include $(SRC_PATH)/tests/fate/atrac.mak
72
include $(SRC_PATH)/tests/fate/audio.mak
Ronald S. Bultje's avatar
Ronald S. Bultje committed
73
include $(SRC_PATH)/tests/fate/bmp.mak
74
include $(SRC_PATH)/tests/fate/cdxl.mak
75
include $(SRC_PATH)/tests/fate/checkasm.mak
76
include $(SRC_PATH)/tests/fate/cover-art.mak
77
include $(SRC_PATH)/tests/fate/demux.mak
Oana Stratulat's avatar
Oana Stratulat committed
78
include $(SRC_PATH)/tests/fate/dfa.mak
79
include $(SRC_PATH)/tests/fate/dpcm.mak
80
include $(SRC_PATH)/tests/fate/ea.mak
81
include $(SRC_PATH)/tests/fate/filter-audio.mak
82
include $(SRC_PATH)/tests/fate/filter-video.mak
83
include $(SRC_PATH)/tests/fate/flac.mak
84 85
include $(SRC_PATH)/tests/fate/fft.mak
include $(SRC_PATH)/tests/fate/h264.mak
Guillaume Martres's avatar
Guillaume Martres committed
86
include $(SRC_PATH)/tests/fate/hevc.mak
87
include $(SRC_PATH)/tests/fate/image.mak
88
include $(SRC_PATH)/tests/fate/indeo.mak
89
include $(SRC_PATH)/tests/fate/libavcodec.mak
90
include $(SRC_PATH)/tests/fate/libavdevice.mak
91
include $(SRC_PATH)/tests/fate/libavformat.mak
92
include $(SRC_PATH)/tests/fate/libavresample.mak
93
include $(SRC_PATH)/tests/fate/libavutil.mak
94 95
include $(SRC_PATH)/tests/fate/lossless-audio.mak
include $(SRC_PATH)/tests/fate/lossless-video.mak
96
include $(SRC_PATH)/tests/fate/microsoft.mak
97
include $(SRC_PATH)/tests/fate/monkeysaudio.mak
98
include $(SRC_PATH)/tests/fate/mp3.mak
99
include $(SRC_PATH)/tests/fate/mpc.mak
100
include $(SRC_PATH)/tests/fate/mpeg4.mak
101
include $(SRC_PATH)/tests/fate/opus.mak
102
include $(SRC_PATH)/tests/fate/pcm.mak
103
include $(SRC_PATH)/tests/fate/probe.mak
Diego Biurrun's avatar
Diego Biurrun committed
104
include $(SRC_PATH)/tests/fate/prores.mak
105
include $(SRC_PATH)/tests/fate/qt.mak
106
include $(SRC_PATH)/tests/fate/qtrle.mak
107
include $(SRC_PATH)/tests/fate/real.mak
108
include $(SRC_PATH)/tests/fate/screen.mak
109
include $(SRC_PATH)/tests/fate/utvideo.mak
110
include $(SRC_PATH)/tests/fate/video.mak
111
include $(SRC_PATH)/tests/fate/voice.mak
112
include $(SRC_PATH)/tests/fate/vorbis.mak
113
include $(SRC_PATH)/tests/fate/vpx.mak
114
include $(SRC_PATH)/tests/fate/vqf.mak
115
include $(SRC_PATH)/tests/fate/wavpack.mak
116
include $(SRC_PATH)/tests/fate/wma.mak
117
include $(SRC_PATH)/tests/fate/xvid.mak
118

119
FATE_AVCONV += $(FATE_AVCONV-yes)
120
FATE-$(CONFIG_AVCONV) += $(FATE_AVCONV)
121

122
FATE_SAMPLES_AVCONV           += $(FATE_SAMPLES_AVCONV-yes)
123 124 125
FATE_SAMPLES-$(CONFIG_AVCONV) += $(FATE_SAMPLES_AVCONV)
FATE_SAMPLES += $(FATE_SAMPLES-yes)

126
FATE += $(FATE-yes)
127

128
$(FATE_AVCONV) $(FATE_SAMPLES_AVCONV): avconv$(EXESUF)
129

130
ifdef SAMPLES
131
FATE += $(FATE_SAMPLES)
132 133 134 135 136
fate-rsync:
	rsync -vaLW rsync://fate-suite.libav.org/fate-suite/ $(SAMPLES)
else
fate-rsync:
	@echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
137 138
$(FATE_SAMPLES):
	@echo "$@ requires external samples and SAMPLES not specified"; false
139 140 141 142 143 144
endif

FATE_UTILS = base64 tiny_psnr

fate: $(FATE)

145
$(FATE): $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
146
	@echo "TEST    $(@:fate-%=%)"
147
	$(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)' '$(GEN)' '$(HWACCEL)'
148 149 150 151

fate-list:
	@printf '%s\n' $(sort $(FATE))

152 153
coverage.info: TAG = LCOV
coverage.info:
154 155 156
	$(M)lcov -q -d $(CURDIR) -b $(SRC_PATH) --capture | \
	    sed "s,$(CURDIR)/\./,$(CURDIR)/," > $@
	$(M)lcov -q --remove $@ "/usr/include*" -o $@
157 158 159

lcov:  TAG = GENHTML
lcov: coverage.info
160
	$(M)genhtml -q -o $(CURDIR)/lcov $<
161 162 163 164 165 166

lcov-reset: TAG = LCOV
lcov-reset:
	$(M)lcov -d $(CURDIR) --zerocounters
	$(Q)$(RM) -f coverage.info

167 168 169
clean:: testclean

testclean:
170
	$(RM) -r tests/vsynth1 tests/data
171
	$(RM) $(CLEANSUFFIXES:%=tests/%)
172
	$(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
173
	$(RM) tests/pixfmts.mak
174 175 176

-include $(wildcard tests/*.d)

177 178
include $(SRC_PATH)/tests/checkasm/Makefile

179 180
.PHONY: fate* lcov lcov-reset
.INTERMEDIATE: coverage.info