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