]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - lib/libarchive/test/Makefile
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / lib / libarchive / test / Makefile
1 # $FreeBSD$
2
3 # Where to find the libarchive sources
4 LA_SRCDIR=${.CURDIR}/..
5 .PATH: ${LA_SRCDIR}
6
7 # Get a list of all libarchive source files
8 LA_SRCS!=make -f ${LA_SRCDIR}/Makefile -V SRCS
9
10 TESTS= \
11         test_acl_basic.c                        \
12         test_acl_freebsd.c                      \
13         test_acl_pax.c                          \
14         test_archive_api_feature.c              \
15         test_bad_fd.c                           \
16         test_compat_bzip2.c                     \
17         test_compat_gtar.c                      \
18         test_compat_gzip.c                      \
19         test_compat_solaris_tar_acl.c           \
20         test_compat_tar_hardlink.c              \
21         test_compat_xz.c                        \
22         test_compat_zip.c                       \
23         test_empty_write.c                      \
24         test_entry.c                            \
25         test_entry_strmode.c                    \
26         test_extattr_freebsd.c                  \
27         test_fuzz.c                             \
28         test_link_resolver.c                    \
29         test_open_fd.c                          \
30         test_open_file.c                        \
31         test_open_filename.c                    \
32         test_pax_filename_encoding.c            \
33         test_read_compress_program.c            \
34         test_read_data_large.c                  \
35         test_read_disk.c                        \
36         test_read_disk_entry_from_file.c        \
37         test_read_extract.c                     \
38         test_read_file_nonexistent.c            \
39         test_read_format_ar.c                   \
40         test_read_format_cpio_bin.c             \
41         test_read_format_cpio_bin_Z.c           \
42         test_read_format_cpio_bin_be.c          \
43         test_read_format_cpio_bin_bz2.c         \
44         test_read_format_cpio_bin_gz.c          \
45         test_read_format_cpio_bin_xz.c          \
46         test_read_format_cpio_odc.c             \
47         test_read_format_cpio_svr4_gzip.c       \
48         test_read_format_cpio_svr4c_Z.c         \
49         test_read_format_empty.c                \
50         test_read_format_gtar_gz.c              \
51         test_read_format_gtar_lzma.c            \
52         test_read_format_gtar_sparse.c          \
53         test_read_format_iso_gz.c               \
54         test_read_format_isojoliet_bz2.c        \
55         test_read_format_isorr_bz2.c            \
56         test_read_format_mtree.c                \
57         test_read_format_pax_bz2.c              \
58         test_read_format_raw.c                  \
59         test_read_format_tar.c                  \
60         test_read_format_tar_empty_filename.c   \
61         test_read_format_tbz.c                  \
62         test_read_format_tgz.c                  \
63         test_read_format_txz.c                  \
64         test_read_format_tz.c                   \
65         test_read_format_zip.c                  \
66         test_read_large.c                       \
67         test_read_pax_truncated.c               \
68         test_read_position.c                    \
69         test_read_truncated.c                   \
70         test_tar_filenames.c                    \
71         test_tar_large.c                        \
72         test_ustar_filenames.c                  \
73         test_write_compress.c                   \
74         test_write_compress_bzip2.c             \
75         test_write_compress_gzip.c              \
76         test_write_compress_lzma.c              \
77         test_write_compress_program.c           \
78         test_write_compress_xz.c                \
79         test_write_disk.c                       \
80         test_write_disk_failures.c              \
81         test_write_disk_hardlink.c              \
82         test_write_disk_perms.c                 \
83         test_write_disk_secure.c                \
84         test_write_disk_sparse.c                \
85         test_write_disk_times.c                 \
86         test_write_format_ar.c                  \
87         test_write_format_cpio.c                \
88         test_write_format_cpio_empty.c          \
89         test_write_format_cpio_newc.c           \
90         test_write_format_cpio_odc.c            \
91         test_write_format_mtree.c               \
92         test_write_format_pax.c                 \
93         test_write_format_shar_empty.c          \
94         test_write_format_tar.c                 \
95         test_write_format_tar_empty.c           \
96         test_write_format_tar_ustar.c           \
97         test_write_open_memory.c
98
99
100 # Build the test program using all libarchive sources + the test sources.
101 SRCS= ${LA_SRCS}                                \
102         ${TESTS}                                \
103         list.h                                  \
104         main.c                                  \
105         read_open_memory.c
106
107 NO_MAN=yes
108
109 PROG=libarchive_test
110 INTERNALPROG=yes  # Don't install this; it's just for testing
111 DPADD=${LIBBZ2} ${LIBZ}
112 CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\"
113 LDADD= -lz -lbz2 -lmd -lcrypto
114 CFLAGS+= -g
115 CFLAGS+= -I${LA_SRCDIR} -I.
116
117 # Uncomment to build and test lzma support via liblzmadec
118 #CFLAGS+= -I/usr/local/include -DHAVE_LIBLZMADEC=1 -DHAVE_LZMADEC_H=1
119 #LDADD+= -L/usr/local/lib -llzmadec
120
121 # Uncomment to build and test lzma and xz support via liblzma
122 #CFLAGS+= -I/usr/local/include -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
123 #LDADD+= -L/usr/local/lib -llzma
124
125 # Uncomment to link against dmalloc
126 #LDADD+= -L/usr/local/lib -ldmalloc
127 #CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
128 WARNS=6
129
130 # Build libarchive_test and run it.
131 check test: libarchive_test
132         ./libarchive_test -v -r ${.CURDIR}
133
134 # list.h is just a list of all tests, as indicated by DEFINE_TEST macro lines
135 list.h: ${TESTS} Makefile
136         (cd ${.CURDIR}; cat test_*.c) | grep DEFINE_TEST > list.h
137
138 CLEANFILES += *.out *.o *.core *~ list.h .dirstamp .depend
139 CLEANDIRS += .deps .libs
140
141 cleantest:
142         -chmod -R +w /tmp/libarchive_test.*
143         rm -rf /tmp/libarchive_test.*
144
145 .include <bsd.prog.mk>