Makefile revision 228797
1# $FreeBSD: head/lib/libarchive/test/Makefile 228797 2011-12-22 08:42:07Z mm $
2
3LIBARCHIVEDIR=	${.CURDIR}/../../../contrib/libarchive
4
5NO_MAN=yes
6
7PROG=libarchive_test
8INTERNALPROG=yes  # Don't install this; it's just for testing
9DPADD=${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBCRYPTO} ${LIBBSDXML}
10LDADD= -L ${.OBJDIR}/.. -larchive
11LDADD+= -lz -lbz2 -llzma -lmd -lcrypto -lbsdxml
12CFLAGS+= -g
13CFLAGS+= -I${.CURDIR}/.. -I${LIBARCHIVEDIR} -I${.OBJDIR}
14CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
15
16# Uncomment to link against dmalloc
17#LDADD+= -L/usr/local/lib -ldmalloc
18#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
19
20.PATH:  ${LIBARCHIVEDIR}/libarchive/test
21TESTS= \
22	test_acl_basic.c			\
23	test_acl_freebsd.c			\
24	test_acl_pax.c				\
25	test_archive_api_feature.c		\
26	test_bad_fd.c				\
27	test_compat_bzip2.c			\
28	test_compat_cpio.c			\
29	test_compat_gtar.c			\
30	test_compat_gzip.c			\
31	test_compat_lzma.c			\
32	test_compat_solaris_tar_acl.c		\
33	test_compat_tar_hardlink.c		\
34	test_compat_xz.c			\
35	test_compat_zip.c			\
36	test_empty_write.c			\
37	test_entry.c				\
38	test_entry_strmode.c			\
39	test_extattr_freebsd.c			\
40	test_fuzz.c				\
41	test_link_resolver.c			\
42	test_open_fd.c				\
43	test_open_failure.c			\
44	test_open_file.c			\
45	test_open_filename.c			\
46	test_pax_filename_encoding.c		\
47	test_read_compress_program.c		\
48	test_read_data_large.c			\
49	test_read_disk.c			\
50	test_read_disk_entry_from_file.c	\
51	test_read_extract.c			\
52	test_read_file_nonexistent.c		\
53	test_read_format_ar.c			\
54	test_read_format_cpio_bin.c		\
55	test_read_format_cpio_bin_Z.c		\
56	test_read_format_cpio_bin_be.c		\
57	test_read_format_cpio_bin_bz2.c		\
58	test_read_format_cpio_bin_gz.c		\
59	test_read_format_cpio_bin_lzma.c	\
60	test_read_format_cpio_bin_xz.c		\
61	test_read_format_cpio_odc.c		\
62	test_read_format_cpio_svr4_gzip.c	\
63	test_read_format_cpio_svr4c_Z.c		\
64	test_read_format_cpio_svr4_bzip2_rpm.c	\
65	test_read_format_cpio_svr4_gzip_rpm.c	\
66	test_read_format_empty.c		\
67	test_read_format_gtar_gz.c		\
68	test_read_format_gtar_lzma.c		\
69	test_read_format_gtar_sparse.c		\
70	test_read_format_iso_Z.c		\
71	test_read_format_iso_multi_extent.c	\
72	test_read_format_isorr_rr_moved.c	\
73	test_read_format_isojoliet_bz2.c	\
74	test_read_format_isojoliet_long.c	\
75	test_read_format_isojoliet_rr.c		\
76	test_read_format_isorr_bz2.c		\
77	test_read_format_isorr_ce.c		\
78	test_read_format_isorr_new_bz2.c	\
79	test_read_format_isozisofs_bz2.c	\
80	test_read_format_mtree.c		\
81	test_read_format_pax_bz2.c		\
82	test_read_format_raw.c			\
83	test_read_format_tar.c			\
84	test_read_format_tar_empty_filename.c	\
85	test_read_format_tbz.c			\
86	test_read_format_tgz.c			\
87	test_read_format_tlz.c			\
88	test_read_format_txz.c			\
89	test_read_format_tz.c			\
90	test_read_format_xar.c			\
91	test_read_format_zip.c			\
92	test_read_large.c			\
93	test_read_pax_truncated.c		\
94	test_read_position.c			\
95	test_read_truncated.c			\
96	test_read_uu.c				\
97	test_tar_filenames.c			\
98	test_tar_large.c			\
99	test_ustar_filenames.c			\
100	test_write_compress.c			\
101	test_write_compress_bzip2.c		\
102	test_write_compress_gzip.c		\
103	test_write_compress_lzma.c		\
104	test_write_compress_program.c		\
105	test_write_compress_xz.c		\
106	test_write_disk.c			\
107	test_write_disk_failures.c		\
108	test_write_disk_hardlink.c		\
109	test_write_disk_perms.c			\
110	test_write_disk_secure.c		\
111	test_write_disk_sparse.c		\
112	test_write_disk_symlink.c		\
113	test_write_disk_times.c			\
114	test_write_format_ar.c			\
115	test_write_format_cpio.c		\
116	test_write_format_cpio_empty.c		\
117	test_write_format_cpio_newc.c		\
118	test_write_format_cpio_odc.c		\
119	test_write_format_mtree.c		\
120	test_write_format_pax.c			\
121	test_write_format_shar_empty.c		\
122	test_write_format_tar.c			\
123	test_write_format_tar_empty.c		\
124	test_write_format_tar_ustar.c		\
125	test_write_format_zip.c			\
126	test_write_format_zip_empty.c		\
127	test_write_format_zip_no_compression.c	\
128	test_write_open_memory.c
129
130
131# Build the test program.
132SRCS= \
133	${TESTS}				\
134	list.h					\
135	main.c					\
136	read_open_memory.c
137
138# Build libarchive_test and run it.
139check test: libarchive_test
140	./libarchive_test -r ${LIBARCHIVEDIR}/libarchive/test
141
142# list.h is just a list of all tests, as indicated by DEFINE_TEST macro lines
143list.h: ${TESTS} Makefile
144	(cd ${LIBARCHIVEDIR}/libarchive/test; cat test_*.c) | \
145	grep DEFINE_TEST > ${.OBJDIR}/list.h
146
147CLEANFILES += *.out *.o *.core *~ list.h .dirstamp .depend
148CLEANDIRS += .deps .libs
149
150cleantest:
151	-chmod -R +w /tmp/libarchive_test.*
152	rm -rf /tmp/libarchive_test.*
153
154.include <bsd.prog.mk>
155