Makefile revision 183482
1# $FreeBSD: head/lib/libarchive/test/Makefile 183482 2008-09-30 03:57:07Z kientzle $
2
3# Where to find the libarchive sources
4LA_SRCDIR=${.CURDIR}/..
5.PATH: ${LA_SRCDIR}
6
7# Get a list of all libarchive source files
8LA_SRCS!=make -f ${LA_SRCDIR}/Makefile -V SRCS
9
10TESTS= \
11	test_acl_basic.c			\
12	test_acl_pax.c				\
13	test_archive_api_feature.c		\
14	test_bad_fd.c				\
15	test_compat_gtar.c			\
16	test_compat_tar_hardlink.c		\
17	test_compat_zip.c			\
18	test_empty_write.c			\
19	test_entry.c				\
20	test_entry_strmode.c			\
21	test_link_resolver.c			\
22	test_pax_filename_encoding.c		\
23	test_read_compress_program.c		\
24	test_read_data_large.c			\
25	test_read_extract.c			\
26	test_read_format_ar.c			\
27	test_read_format_cpio_bin.c		\
28	test_read_format_cpio_bin_Z.c		\
29	test_read_format_cpio_bin_bz2.c		\
30	test_read_format_cpio_bin_gz.c		\
31	test_read_format_cpio_odc.c		\
32	test_read_format_cpio_svr4_gzip.c	\
33	test_read_format_cpio_svr4c_Z.c		\
34	test_read_format_empty.c		\
35	test_read_format_gtar_gz.c		\
36	test_read_format_gtar_sparse.c		\
37	test_read_format_iso_gz.c		\
38	test_read_format_isorr_bz2.c		\
39	test_read_format_mtree.c		\
40	test_read_format_pax_bz2.c		\
41	test_read_format_tar.c			\
42	test_read_format_tar_empty_filename.c	\
43	test_read_format_tbz.c			\
44	test_read_format_tgz.c			\
45	test_read_format_tz.c			\
46	test_read_format_zip.c			\
47	test_read_large.c			\
48	test_read_pax_truncated.c		\
49	test_read_position.c			\
50	test_read_truncated.c			\
51	test_tar_filenames.c			\
52	test_tar_large.c			\
53	test_ustar_filenames.c			\
54	test_write_compress.c			\
55	test_write_compress_program.c		\
56	test_write_disk.c			\
57	test_write_disk_hardlink.c		\
58	test_write_disk_perms.c			\
59	test_write_disk_secure.c		\
60	test_write_format_ar.c			\
61	test_write_format_cpio.c		\
62	test_write_format_cpio_empty.c		\
63	test_write_format_cpio_newc.c		\
64	test_write_format_cpio_odc.c		\
65	test_write_format_pax.c			\
66	test_write_format_shar_empty.c		\
67	test_write_format_tar.c			\
68	test_write_format_tar_empty.c		\
69	test_write_format_tar_ustar.c		\
70	test_write_open_memory.c
71
72
73# Build the test program using all libarchive sources + the test sources.
74SRCS= ${LA_SRCS}				\
75	${TESTS}				\
76	list.h					\
77	main.c					\
78	read_open_memory.c
79
80NO_MAN=yes
81
82PROG=libarchive_test
83INTERNALPROG=yes  # Don't install this; it's just for testing
84DPADD=${LIBBZ2} ${LIBZ}
85CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\"
86LDADD= -lz -lbz2
87CFLAGS+= -static -g
88CFLAGS+= -I${LA_SRCDIR} -I.
89
90# Uncomment to link against dmalloc
91#LDADD+= -L/usr/local/lib -ldmalloc
92#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
93WARNS=6
94
95# Build libarchive_test and run it.
96check test: libarchive_test
97	./libarchive_test -v -r ${.CURDIR}
98
99# list.h is just a list of all tests, as indicated by DEFINE_TEST macro lines
100list.h: ${TESTS} Makefile
101	(cd ${.CURDIR}; cat ${TESTS}) | grep DEFINE_TEST > list.h
102
103CLEANFILES += *.out *.o *.core *~ list.h
104
105cleantest:
106	-chmod -R +w /tmp/libarchive_test.*
107	rm -rf /tmp/libarchive_test.*
108
109.include <bsd.prog.mk>
110