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