Makefile revision 306941
1# $FreeBSD: releng/10.1/lib/libarchive/test/Makefile 306941 2016-10-10 07:18:54Z delphij $
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${.OBJDIR}
14CFLAGS+= -I${LIBARCHIVEDIR}/libarchive -I${LIBARCHIVEDIR}/test_utils
15CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
16
17# Uncomment to link against dmalloc
18#LDADD+= -L/usr/local/lib -ldmalloc
19#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
20
21.PATH:  ${LIBARCHIVEDIR}/libarchive/test
22TESTS= \
23	test_acl_freebsd_nfs4.c			\
24	test_acl_freebsd_posix1e.c		\
25	test_acl_nfs4.c				\
26	test_acl_pax.c				\
27	test_acl_posix1e.c			\
28	test_archive_api_feature.c		\
29	test_archive_clear_error.c		\
30	test_archive_cmdline.c			\
31	test_archive_crypto.c			\
32	test_archive_getdate.c			\
33	test_archive_match_time.c		\
34	test_archive_match_owner.c		\
35	test_archive_match_path.c		\
36	test_archive_pathmatch.c		\
37	test_archive_read_close_twice.c		\
38	test_archive_read_close_twice_open_fd.c	\
39	test_archive_read_close_twice_open_filename.c	\
40	test_archive_read_multiple_data_objects.c	\
41	test_archive_read_next_header_empty.c	\
42	test_archive_read_next_header_raw.c	\
43	test_archive_read_open2.c		\
44	test_archive_read_set_filter_option.c	\
45	test_archive_read_set_format_option.c	\
46	test_archive_read_set_option.c		\
47	test_archive_read_set_options.c		\
48	test_archive_read_support.c		\
49	test_archive_set_error.c		\
50	test_archive_string.c			\
51	test_archive_string_conversion.c	\
52	test_archive_write_add_filter_by_name.c	\
53	test_archive_write_set_filter_option.c	\
54	test_archive_write_set_format_by_name.c	\
55	test_archive_write_set_format_option.c	\
56	test_archive_write_set_option.c		\
57	test_archive_write_set_options.c	\
58	test_bad_fd.c				\
59	test_compat_bzip2.c			\
60	test_compat_cpio.c			\
61	test_compat_gtar.c			\
62	test_compat_gzip.c			\
63	test_compat_lzip.c			\
64	test_compat_lzma.c			\
65	test_compat_lzop.c			\
66	test_compat_mac.c			\
67	test_compat_pax_libarchive_2x.c		\
68	test_compat_solaris_tar_acl.c		\
69	test_compat_solaris_pax_sparse.c	\
70	test_compat_tar_hardlink.c		\
71	test_compat_uudecode.c			\
72	test_compat_xz.c			\
73	test_compat_zip.c			\
74	test_empty_write.c			\
75	test_entry.c				\
76	test_entry_strmode.c			\
77	test_extattr_freebsd.c			\
78	test_filter_count.c			\
79	test_fuzz.c				\
80	test_gnutar_filename_encoding.c		\
81	test_link_resolver.c			\
82	test_open_fd.c				\
83	test_open_failure.c			\
84	test_open_file.c			\
85	test_open_filename.c			\
86	test_pax_filename_encoding.c		\
87	test_read_data_large.c			\
88	test_read_disk.c			\
89	test_read_disk_directory_traversals.c	\
90	test_read_disk_entry_from_file.c	\
91	test_read_extract.c			\
92	test_read_file_nonexistent.c		\
93	test_read_filter_grzip.c		\
94	test_read_filter_lrzip.c		\
95	test_read_filter_lzop.c			\
96	test_read_filter_lzop_multiple_parts.c	\
97	test_read_filter_program.c		\
98	test_read_filter_program_signature.c	\
99	test_read_filter_uudecode.c		\
100	test_read_format_7zip.c			\
101	test_read_format_ar.c			\
102	test_read_format_cab.c			\
103	test_read_format_cab_filename.c		\
104	test_read_format_cpio_afio.c		\
105	test_read_format_cpio_bin.c		\
106	test_read_format_cpio_bin_Z.c		\
107	test_read_format_cpio_bin_be.c		\
108	test_read_format_cpio_bin_bz2.c		\
109	test_read_format_cpio_bin_gz.c		\
110	test_read_format_cpio_bin_lzip.c	\
111	test_read_format_cpio_bin_lzma.c	\
112	test_read_format_cpio_bin_xz.c		\
113	test_read_format_cpio_filename.c	\
114	test_read_format_cpio_odc.c		\
115	test_read_format_cpio_svr4_gzip.c	\
116	test_read_format_cpio_svr4c_Z.c		\
117	test_read_format_cpio_svr4_bzip2_rpm.c	\
118	test_read_format_cpio_svr4_gzip_rpm.c	\
119	test_read_format_empty.c		\
120	test_read_format_gtar_filename.c	\
121	test_read_format_gtar_gz.c		\
122	test_read_format_gtar_lzma.c		\
123	test_read_format_gtar_sparse.c		\
124	test_read_format_iso_Z.c		\
125	test_read_format_iso_multi_extent.c	\
126	test_read_format_iso_xorriso.c		\
127	test_read_format_isorr_rr_moved.c	\
128	test_read_format_isojoliet_bz2.c	\
129	test_read_format_isojoliet_long.c	\
130	test_read_format_isojoliet_rr.c		\
131	test_read_format_isojoliet_versioned.c	\
132	test_read_format_isorr_bz2.c		\
133	test_read_format_isorr_ce.c		\
134	test_read_format_isorr_new_bz2.c	\
135	test_read_format_isozisofs_bz2.c	\
136	test_read_format_lha.c			\
137	test_read_format_lha_filename.c		\
138	test_read_format_mtree.c		\
139	test_read_format_pax_bz2.c		\
140	test_read_format_rar.c			\
141	test_read_format_raw.c			\
142	test_read_format_tar.c			\
143	test_read_format_tar_empty_filename.c	\
144	test_read_format_tar_filename.c		\
145	test_read_format_tbz.c			\
146	test_read_format_tgz.c			\
147	test_read_format_tlz.c			\
148	test_read_format_txz.c			\
149	test_read_format_tz.c			\
150	test_read_format_ustar_filename.c	\
151	test_read_format_xar.c			\
152	test_read_format_zip.c			\
153	test_read_format_zip_comment_stored.c	\
154	test_read_format_zip_filename.c		\
155	test_read_format_zip_mac_metadata.c	\
156	test_read_format_zip_sfx.c		\
157	test_read_large.c			\
158	test_read_pax_truncated.c		\
159	test_read_position.c			\
160	test_read_set_format.c			\
161	test_read_truncated.c			\
162	test_read_truncated_filter.c		\
163	test_sparse_basic.c			\
164	test_tar_filenames.c			\
165	test_tar_large.c			\
166	test_ustar_filenames.c			\
167	test_ustar_filename_encoding.c		\
168	test_write_disk.c			\
169	test_write_disk_appledouble.c		\
170	test_write_disk_failures.c		\
171	test_write_disk_hardlink.c		\
172	test_write_disk_hfs_compression.c	\
173	test_write_disk_lookup.c		\
174	test_write_disk_mac_metadata.c		\
175	test_write_disk_no_hfs_compression.c	\
176	test_write_disk_perms.c			\
177	test_write_disk_secure.c		\
178	test_write_disk_secure744.c		\
179	test_write_disk_secure745.c		\
180	test_write_disk_secure746.c		\
181	test_write_disk_sparse.c		\
182	test_write_disk_symlink.c		\
183	test_write_disk_times.c			\
184	test_write_filter_b64encode.c		\
185	test_write_filter_bzip2.c		\
186	test_write_filter_compress.c		\
187	test_write_filter_gzip.c		\
188	test_write_filter_gzip_timestamp.c	\
189	test_write_filter_lrzip.c		\
190	test_write_filter_lzip.c		\
191	test_write_filter_lzma.c		\
192	test_write_filter_lzop.c		\
193	test_write_filter_program.c		\
194	test_write_filter_uuencode.c		\
195	test_write_filter_xz.c			\
196	test_write_format_7zip.c		\
197	test_write_format_7zip_empty.c		\
198	test_write_format_7zip_large.c		\
199	test_write_format_ar.c			\
200	test_write_format_cpio.c		\
201	test_write_format_cpio_empty.c		\
202	test_write_format_cpio_newc.c		\
203	test_write_format_cpio_odc.c		\
204	test_write_format_gnutar.c		\
205	test_write_format_iso9660.c		\
206	test_write_format_iso9660_boot.c	\
207	test_write_format_iso9660_empty.c	\
208	test_write_format_iso9660_filename.c	\
209	test_write_format_iso9660_zisofs.c	\
210	test_write_format_mtree.c		\
211	test_write_format_mtree_absolute_path.c	\
212	test_write_format_mtree_classic.c	\
213	test_write_format_mtree_classic_indent.c	\
214	test_write_format_mtree_fflags.c	\
215	test_write_format_mtree_no_separator.c	\
216	test_write_format_mtree_quoted_filename.c	\
217	test_write_format_pax.c			\
218	test_write_format_shar_empty.c		\
219	test_write_format_tar.c			\
220	test_write_format_tar_empty.c		\
221	test_write_format_tar_sparse.c		\
222	test_write_format_tar_ustar.c		\
223	test_write_format_tar_v7tar.c		\
224	test_write_format_xar.c			\
225	test_write_format_xar_empty.c		\
226	test_write_format_zip.c			\
227	test_write_format_zip_empty.c		\
228	test_write_format_zip_no_compression.c	\
229	test_write_zip_set_compression_store.c	\
230	test_write_open_memory.c		\
231	test_zip_filename_encoding.c
232
233# Build the test program.
234SRCS= \
235	${TESTS}				\
236	list.h					\
237	main.c					\
238	read_open_memory.c
239
240.PATH:	${LIBARCHIVEDIR}/test_utils
241SRCS+=	test_utils.c
242
243# Build libarchive_test and run it.
244check test: libarchive_test
245	./libarchive_test -r ${LIBARCHIVEDIR}/libarchive/test
246
247# list.h is just a list of all tests, as indicated by DEFINE_TEST macro lines
248list.h: ${TESTS} Makefile
249	(cd ${LIBARCHIVEDIR}/libarchive/test; cat test_*.c) | \
250	grep DEFINE_TEST > ${.OBJDIR}/list.h
251
252CLEANFILES += *.out *.o *.core *~ list.h .dirstamp .depend
253CLEANDIRS += .deps .libs
254
255cleantest:
256	-chmod -R +w /tmp/libarchive_test.*
257	rm -rf /tmp/libarchive_test.*
258
259.include <bsd.prog.mk>
260