xref: /freebsd/usr.bin/unzip/tests/Makefile (revision b5a3a89c50671a1ad29e7c43fe15e7b16feac239)
1*b5a3a89cSMartin Matuska# $FreeBSD$
2*b5a3a89cSMartin Matuska
3*b5a3a89cSMartin MatuskaPACKAGE=	tests
4*b5a3a89cSMartin Matuska
5*b5a3a89cSMartin Matuska_LIBARCHIVEDIR=	${SRCTOP}/contrib/libarchive
6*b5a3a89cSMartin Matuska
7*b5a3a89cSMartin MatuskaATF_TESTS_SH+=	functional_test
8*b5a3a89cSMartin Matuska
9*b5a3a89cSMartin MatuskaBINDIR=		${TESTSDIR}
10*b5a3a89cSMartin Matuska
11*b5a3a89cSMartin MatuskaPROGS+=		bsdunzip_test
12*b5a3a89cSMartin Matuska
13*b5a3a89cSMartin MatuskaCFLAGS+=	-DPLATFORM_CONFIG_H=\"${SRCTOP}/lib/libarchive/config_freebsd.h\"
14*b5a3a89cSMartin MatuskaCFLAGS+=	-I${SRCTOP}/lib/libarchive -I${.OBJDIR}
15*b5a3a89cSMartin Matuska
16*b5a3a89cSMartin MatuskaCFLAGS+=	-I${.OBJDIR}
17*b5a3a89cSMartin MatuskaCFLAGS+=	-I${_LIBARCHIVEDIR}/unzip -I${_LIBARCHIVEDIR}/unzip/test
18*b5a3a89cSMartin MatuskaCFLAGS+=	-I${_LIBARCHIVEDIR}/libarchive
19*b5a3a89cSMartin MatuskaCFLAGS+=	-I${_LIBARCHIVEDIR}/libarchive_fe -I${_LIBARCHIVEDIR}/test_utils
20*b5a3a89cSMartin Matuska
21*b5a3a89cSMartin Matuska# Uncomment to link against dmalloc
22*b5a3a89cSMartin Matuska#LDADD+= -L/usr/local/lib -ldmalloc
23*b5a3a89cSMartin Matuska#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
24*b5a3a89cSMartin Matuska
25*b5a3a89cSMartin MatuskaCFLAGS.test_utils.c+=	-Wno-cast-align
26*b5a3a89cSMartin Matuska
27*b5a3a89cSMartin Matuska.PATH:	${_LIBARCHIVEDIR}/libarchive_fe
28*b5a3a89cSMartin MatuskaUNZIP_SRCS+= err.c
29*b5a3a89cSMartin Matuska
30*b5a3a89cSMartin Matuska.PATH:	${_LIBARCHIVEDIR}/unzip/test
31*b5a3a89cSMartin MatuskaTESTS_SRCS=	\
32*b5a3a89cSMartin Matuska	test_0.c 				\
33*b5a3a89cSMartin Matuska	test_C.c				\
34*b5a3a89cSMartin Matuska	test_L.c				\
35*b5a3a89cSMartin Matuska	test_P_encryption.c			\
36*b5a3a89cSMartin Matuska	test_Z1.c				\
37*b5a3a89cSMartin Matuska	test_basic.c				\
38*b5a3a89cSMartin Matuska	test_d.c				\
39*b5a3a89cSMartin Matuska	test_glob.c				\
40*b5a3a89cSMartin Matuska	test_j.c				\
41*b5a3a89cSMartin Matuska	test_n.c				\
42*b5a3a89cSMartin Matuska	test_not_exist.c			\
43*b5a3a89cSMartin Matuska	test_o.c				\
44*b5a3a89cSMartin Matuska	test_p.c				\
45*b5a3a89cSMartin Matuska	test_q.c				\
46*b5a3a89cSMartin Matuska	test_singlefile.c 			\
47*b5a3a89cSMartin Matuska	test_t.c				\
48*b5a3a89cSMartin Matuska	test_t_bad.c				\
49*b5a3a89cSMartin Matuska	test_version.c				\
50*b5a3a89cSMartin Matuska	test_x.c
51*b5a3a89cSMartin Matuska
52*b5a3a89cSMartin MatuskaSRCS.bsdunzip_test= list.h			\
53*b5a3a89cSMartin Matuska	${UNZIP_SRCS}				\
54*b5a3a89cSMartin Matuska	${TESTS_SRCS}
55*b5a3a89cSMartin Matuska
56*b5a3a89cSMartin Matuska.PATH:	${_LIBARCHIVEDIR}/test_utils
57*b5a3a89cSMartin MatuskaSRCS.bsdunzip_test+=	test_main.c		\
58*b5a3a89cSMartin Matuska			test_utils.c
59*b5a3a89cSMartin Matuska
60*b5a3a89cSMartin MatuskaLIBADD.bsdunzip_test=	archive
61*b5a3a89cSMartin Matuska
62*b5a3a89cSMartin Matuskalist.h: ${TESTS_SRCS} Makefile
63*b5a3a89cSMartin Matuska	@(cd ${_LIBARCHIVEDIR}/unzip/test && \
64*b5a3a89cSMartin Matuska	grep -h DEFINE_TEST ${.ALLSRC:N*Makefile}) > ${.TARGET}.tmp
65*b5a3a89cSMartin Matuska	@mv ${.TARGET}.tmp ${.TARGET}
66*b5a3a89cSMartin Matuska
67*b5a3a89cSMartin MatuskaCLEANFILES+=	list.h list.h.tmp
68*b5a3a89cSMartin Matuska
69*b5a3a89cSMartin Matuska${PACKAGE}FILES+= test_basic.zip.uu
70*b5a3a89cSMartin Matuska${PACKAGE}FILES+= test_encrypted.zip.uu
71*b5a3a89cSMartin Matuska${PACKAGE}FILES+= test_singlefile.zip.uu
72*b5a3a89cSMartin Matuska${PACKAGE}FILES+= test_t_bad.zip.uu
73*b5a3a89cSMartin Matuska
74*b5a3a89cSMartin Matuska.include <bsd.test.mk>
75