Exit with error when running libavtest and not configured with --enable-gpl.
[libav.git] / tests / Makefile
1 #
2 # Makefile for tests
3 # (c) 2002 Fabrice Bellard
4 #
5 include ../config.mak
6
7 VPATH = $(SRC_PATH_BARE)/tests
8 SRC_DIR = $(SRC_PATH)/tests
9 BUILD_DIR = $(BUILD_ROOT)/tests
10 CFLAGS = -O2 -Wall -g
11
12 FFMPEG_REFFILE = $(SRC_DIR)/ffmpeg.regression.ref
13 FFSERVER_REFFILE = $(SRC_DIR)/ffserver.regression.ref
14 LIBAV_REFFILE = $(SRC_DIR)/libav.regression.ref
15 ROTOZOOM_REFFILE = $(SRC_DIR)/rotozoom.regression.ref
16 SEEK_REFFILE = $(SRC_DIR)/seek.regression.ref
17
18 all fulltest test: codectest libavtest seektest
19
20 test-server: vsynth1/00.pgm asynth1.sw
21 @echo
22 @echo "Unfortunately ffserver is broken and therefore its regression"
23 @echo "test fails randomly. Treat the results accordingly."
24 @echo
25 $(SRC_DIR)/server-regression.sh $(FFSERVER_REFFILE) $(SRC_DIR)/test.conf
26
27 codectest mpeg4 mpeg ac3 snow snowll: vsynth1/00.pgm vsynth2/00.pgm asynth1.sw tiny_psnr$(EXESUF)
28 $(SRC_DIR)/regression.sh $@ $(FFMPEG_REFFILE) vsynth1
29 $(SRC_DIR)/regression.sh $@ $(ROTOZOOM_REFFILE) vsynth2
30
31 ifeq ($(CONFIG_GPL),yes)
32 libavtest: vsynth1/00.pgm asynth1.sw
33 $(SRC_DIR)/regression.sh $@ $(LIBAV_REFFILE) vsynth1
34 else
35 libavtest:
36 @echo
37 @echo "This test requires FFmpeg to be compiled with --enable-gpl."
38 @echo
39 @exit 1
40 endif
41
42 ifeq ($(CONFIG_SWSCALER),yes)
43 test-server codectest mpeg4 mpeg ac3 snow snowll libavtest: swscale_error
44 swscale_error:
45 @echo
46 @echo "This regression test is incompatible with --enable-swscaler."
47 @echo
48 @exit 1
49 endif
50
51 seektest: seek_test$(EXESUF)
52 $(SRC_DIR)/seek_test.sh $(SEEK_REFFILE)
53
54 vsynth1/00.pgm: videogen$(EXESUF)
55 mkdir -p vsynth1
56 $(BUILD_DIR)/$< 'vsynth1/'
57
58 vsynth2/00.pgm: rotozoom$(EXESUF)
59 mkdir -p vsynth2
60 $(BUILD_DIR)/$< 'vsynth2/' $(SRC_DIR)/lena.pnm
61
62 asynth1.sw: audiogen$(EXESUF)
63 $(BUILD_DIR)/$< $@
64
65 %$(EXESUF): %.c
66 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
67
68 seek_test$(EXESUF): seek_test.c
69 $(CC) $(LDFLAGS) $(CFLAGS) -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavutil -o $@ $< $(BUILD_ROOT)/libavformat/libavformat.a $(BUILD_ROOT)/libavcodec/libavcodec.a $(BUILD_ROOT)/libavutil/libavutil.a $(EXTRALIBS)
70
71 distclean clean:
72 rm -rf vsynth1 vsynth2 data asynth1.sw *~
73 rm -f $(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr)
74
75 .PHONY: all fulltest test codectest libavtest test-server seektest
76 .PHONY: mpeg4 mpeg ac3 snow snowll distclean clean