1 ############################################
3 # How to build libarchive_test
5 ############################################
7 SET(libarchive_test_SOURCES
8 ../../test_utils/test_utils.c
9 ../../test_utils/test_main.c
14 test_acl_platform_nfs4.c
15 test_acl_platform_posix1e.c
18 test_archive_api_feature.c
19 test_archive_clear_error.c
20 test_archive_cmdline.c
22 test_archive_getdate.c
23 test_archive_match_owner.c
24 test_archive_match_path.c
25 test_archive_match_time.c
26 test_archive_pathmatch.c
27 test_archive_read_add_passphrase.c
28 test_archive_read_close_twice.c
29 test_archive_read_close_twice_open_fd.c
30 test_archive_read_close_twice_open_filename.c
31 test_archive_read_multiple_data_objects.c
32 test_archive_read_next_header_empty.c
33 test_archive_read_next_header_raw.c
34 test_archive_read_open2.c
35 test_archive_read_set_filter_option.c
36 test_archive_read_set_format_option.c
37 test_archive_read_set_option.c
38 test_archive_read_set_options.c
39 test_archive_read_support.c
40 test_archive_set_error.c
42 test_archive_string_conversion.c
43 test_archive_write_add_filter_by_name.c
44 test_archive_write_set_filter_option.c
45 test_archive_write_set_format_by_name.c
46 test_archive_write_set_format_filter_by_ext.c
47 test_archive_write_set_format_option.c
48 test_archive_write_set_option.c
49 test_archive_write_set_options.c
50 test_archive_write_set_passphrase.c
61 test_compat_pax_libarchive_2x.c
62 test_compat_perl_archive_tar.c
63 test_compat_plexus_archiver_tar.c
64 test_compat_solaris_pax_sparse.c
65 test_compat_solaris_tar_acl.c
66 test_compat_star_acl.c
67 test_compat_tar_hardlink.c
68 test_compat_uudecode.c
69 test_compat_uudecode_large.c
76 test_extattr_freebsd.c
79 test_gnutar_filename_encoding.c
85 test_pax_filename_encoding.c
86 test_read_data_large.c
88 test_read_disk_directory_traversals.c
89 test_read_disk_entry_from_file.c
91 test_read_file_nonexistent.c
92 test_read_filter_compress.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_7zip_encryption_data.c
102 test_read_format_7zip_encryption_header.c
103 test_read_format_7zip_encryption_partially.c
104 test_read_format_7zip_malformed.c
105 test_read_format_ar.c
106 test_read_format_cab.c
107 test_read_format_cab_filename.c
108 test_read_format_cpio_afio.c
109 test_read_format_cpio_bin.c
110 test_read_format_cpio_bin_Z.c
111 test_read_format_cpio_bin_be.c
112 test_read_format_cpio_bin_bz2.c
113 test_read_format_cpio_bin_gz.c
114 test_read_format_cpio_bin_le.c
115 test_read_format_cpio_bin_lzip.c
116 test_read_format_cpio_bin_lzma.c
117 test_read_format_cpio_bin_xz.c
118 test_read_format_cpio_filename.c
119 test_read_format_cpio_odc.c
120 test_read_format_cpio_svr4_bzip2_rpm.c
121 test_read_format_cpio_svr4_gzip.c
122 test_read_format_cpio_svr4_gzip_rpm.c
123 test_read_format_cpio_svr4c_Z.c
124 test_read_format_empty.c
125 test_read_format_gtar_filename.c
126 test_read_format_gtar_gz.c
127 test_read_format_gtar_lzma.c
128 test_read_format_gtar_sparse.c
129 test_read_format_gtar_sparse_skip_entry.c
130 test_read_format_iso_Z.c
131 test_read_format_iso_multi_extent.c
132 test_read_format_iso_xorriso.c
133 test_read_format_isojoliet_bz2.c
134 test_read_format_isojoliet_long.c
135 test_read_format_isojoliet_rr.c
136 test_read_format_isojoliet_versioned.c
137 test_read_format_isorr_bz2.c
138 test_read_format_isorr_ce.c
139 test_read_format_isorr_new_bz2.c
140 test_read_format_isorr_rr_moved.c
141 test_read_format_isozisofs_bz2.c
142 test_read_format_lha.c
143 test_read_format_lha_bugfix_0.c
144 test_read_format_lha_filename.c
145 test_read_format_mtree.c
146 test_read_format_mtree_crash747.c
147 test_read_format_pax_bz2.c
148 test_read_format_rar.c
149 test_read_format_rar_encryption_data.c
150 test_read_format_rar_encryption_header.c
151 test_read_format_rar_encryption_partially.c
152 test_read_format_rar_invalid1.c
153 test_read_format_rar5.c
154 test_read_format_raw.c
155 test_read_format_tar.c
156 test_read_format_tar_concatenated.c
157 test_read_format_tar_empty_filename.c
158 test_read_format_tar_empty_pax.c
159 test_read_format_tar_filename.c
160 test_read_format_tbz.c
161 test_read_format_tgz.c
162 test_read_format_tlz.c
163 test_read_format_txz.c
164 test_read_format_tz.c
165 test_read_format_ustar_filename.c
166 test_read_format_warc.c
167 test_read_format_xar.c
168 test_read_format_zip.c
169 test_read_format_zip_comment_stored.c
170 test_read_format_zip_encryption_data.c
171 test_read_format_zip_encryption_header.c
172 test_read_format_zip_encryption_partially.c
173 test_read_format_zip_filename.c
174 test_read_format_zip_high_compression.c
175 test_read_format_zip_jar.c
176 test_read_format_zip_mac_metadata.c
177 test_read_format_zip_malformed.c
178 test_read_format_zip_msdos.c
179 test_read_format_zip_nested.c
180 test_read_format_zip_nofiletype.c
181 test_read_format_zip_padded.c
182 test_read_format_zip_sfx.c
183 test_read_format_zip_traditional_encryption_data.c
184 test_read_format_zip_winzip_aes.c
185 test_read_format_zip_winzip_aes_large.c
186 test_read_format_zip_zip64.c
187 test_read_format_zip_with_invalid_traditional_eocd.c
189 test_read_pax_schily_xattr.c
190 test_read_pax_truncated.c
192 test_read_set_format.c
193 test_read_too_many_filters.c
194 test_read_truncated.c
195 test_read_truncated_filter.c
199 test_ustar_filename_encoding.c
200 test_ustar_filenames.c
201 test_warn_missing_hardlink_target.c
203 test_write_disk_appledouble.c
204 test_write_disk_failures.c
205 test_write_disk_hardlink.c
206 test_write_disk_hfs_compression.c
207 test_write_disk_lookup.c
208 test_write_disk_mac_metadata.c
209 test_write_disk_no_hfs_compression.c
210 test_write_disk_perms.c
211 test_write_disk_secure.c
212 test_write_disk_secure744.c
213 test_write_disk_secure745.c
214 test_write_disk_secure746.c
215 test_write_disk_sparse.c
216 test_write_disk_symlink.c
217 test_write_disk_times.c
218 test_write_filter_b64encode.c
219 test_write_filter_bzip2.c
220 test_write_filter_compress.c
221 test_write_filter_gzip.c
222 test_write_filter_gzip_timestamp.c
223 test_write_filter_lrzip.c
224 test_write_filter_lz4.c
225 test_write_filter_lzip.c
226 test_write_filter_lzma.c
227 test_write_filter_lzop.c
228 test_write_filter_program.c
229 test_write_filter_uuencode.c
230 test_write_filter_xz.c
231 test_write_filter_zstd.c
232 test_write_format_7zip.c
233 test_write_format_7zip_empty.c
234 test_write_format_7zip_large.c
235 test_write_format_ar.c
236 test_write_format_cpio.c
237 test_write_format_cpio_empty.c
238 test_write_format_cpio_newc.c
239 test_write_format_cpio_odc.c
240 test_write_format_gnutar.c
241 test_write_format_gnutar_filenames.c
242 test_write_format_iso9660.c
243 test_write_format_iso9660_boot.c
244 test_write_format_iso9660_empty.c
245 test_write_format_iso9660_filename.c
246 test_write_format_iso9660_zisofs.c
247 test_write_format_mtree.c
248 test_write_format_mtree_absolute_path.c
249 test_write_format_mtree_classic.c
250 test_write_format_mtree_classic_indent.c
251 test_write_format_mtree_fflags.c
252 test_write_format_mtree_no_separator.c
253 test_write_format_mtree_quoted_filename.c
254 test_write_format_pax.c
255 test_write_format_raw.c
256 test_write_format_raw_b64.c
257 test_write_format_shar_empty.c
258 test_write_format_tar.c
259 test_write_format_tar_empty.c
260 test_write_format_tar_sparse.c
261 test_write_format_tar_ustar.c
262 test_write_format_tar_v7tar.c
263 test_write_format_warc.c
264 test_write_format_warc_empty.c
265 test_write_format_xar.c
266 test_write_format_xar_empty.c
267 test_write_format_zip.c
268 test_write_format_zip_compression_store.c
269 test_write_format_zip_empty.c
270 test_write_format_zip_empty_zip64.c
271 test_write_format_zip_file.c
272 test_write_format_zip_file_zip64.c
273 test_write_format_zip_large.c
274 test_write_format_zip_zip64.c
275 test_write_open_memory.c
276 test_write_read_format_zip.c
277 test_xattr_platform.c
278 test_zip_filename_encoding.c
284 ADD_EXECUTABLE(libarchive_test ${libarchive_test_SOURCES})
285 TARGET_LINK_LIBRARIES(libarchive_test archive_static ${ADDITIONAL_LIBS})
286 SET_PROPERTY(TARGET libarchive_test PROPERTY COMPILE_DEFINITIONS
287 LIBARCHIVE_STATIC LIST_H)
290 # Generate list.h by grepping DEFINE_TEST() lines out of the C sources.
292 GENERATE_LIST_H(${CMAKE_CURRENT_BINARY_DIR}/list.h
293 ${CMAKE_CURRENT_LIST_FILE} ${libarchive_test_SOURCES})
294 SET_PROPERTY(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
295 ${CMAKE_CURRENT_BINARY_DIR})
297 # list.h has a line DEFINE_TEST(testname) for every
298 # test. We can use that to define the tests for cmake by
299 # defining a DEFINE_TEST macro and reading list.h in.
300 MACRO (DEFINE_TEST _testname)
302 NAME libarchive_${_testname}
303 COMMAND libarchive_test -vv
304 -r ${CMAKE_CURRENT_SOURCE_DIR}
306 ENDMACRO (DEFINE_TEST _testname)
308 INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
309 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
310 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/test_utils)
311 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libarchive/test)
313 # Experimental new test handling
314 ADD_CUSTOM_TARGET(run_libarchive_test
315 COMMAND libarchive_test -r ${CMAKE_CURRENT_SOURCE_DIR} -vv)
316 ADD_DEPENDENCIES(run_all_tests run_libarchive_test)