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_perl_archive_tar.c
62 test_compat_plexus_archiver_tar.c
63 test_compat_solaris_pax_sparse.c
64 test_compat_solaris_tar_acl.c
65 test_compat_star_acl.c
66 test_compat_tar_hardlink.c
67 test_compat_uudecode.c
68 test_compat_uudecode_large.c
75 test_extattr_freebsd.c
78 test_gnutar_filename_encoding.c
84 test_pax_filename_encoding.c
85 test_read_data_large.c
87 test_read_disk_directory_traversals.c
88 test_read_disk_entry_from_file.c
90 test_read_file_nonexistent.c
91 test_read_filter_compress.c
92 test_read_filter_grzip.c
93 test_read_filter_lrzip.c
94 test_read_filter_lzop.c
95 test_read_filter_lzop_multiple_parts.c
96 test_read_filter_program.c
97 test_read_filter_program_signature.c
98 test_read_filter_uudecode.c
99 test_read_format_7zip.c
100 test_read_format_7zip_encryption_data.c
101 test_read_format_7zip_encryption_header.c
102 test_read_format_7zip_encryption_partially.c
103 test_read_format_7zip_malformed.c
104 test_read_format_ar.c
105 test_read_format_cab.c
106 test_read_format_cab_filename.c
107 test_read_format_cpio_afio.c
108 test_read_format_cpio_bin.c
109 test_read_format_cpio_bin_Z.c
110 test_read_format_cpio_bin_be.c
111 test_read_format_cpio_bin_bz2.c
112 test_read_format_cpio_bin_gz.c
113 test_read_format_cpio_bin_le.c
114 test_read_format_cpio_bin_lzip.c
115 test_read_format_cpio_bin_lzma.c
116 test_read_format_cpio_bin_xz.c
117 test_read_format_cpio_filename.c
118 test_read_format_cpio_odc.c
119 test_read_format_cpio_svr4_bzip2_rpm.c
120 test_read_format_cpio_svr4_gzip.c
121 test_read_format_cpio_svr4_gzip_rpm.c
122 test_read_format_cpio_svr4c_Z.c
123 test_read_format_empty.c
124 test_read_format_gtar_filename.c
125 test_read_format_gtar_gz.c
126 test_read_format_gtar_lzma.c
127 test_read_format_gtar_sparse.c
128 test_read_format_gtar_sparse_skip_entry.c
129 test_read_format_iso_Z.c
130 test_read_format_iso_multi_extent.c
131 test_read_format_iso_xorriso.c
132 test_read_format_isojoliet_bz2.c
133 test_read_format_isojoliet_long.c
134 test_read_format_isojoliet_rr.c
135 test_read_format_isojoliet_versioned.c
136 test_read_format_isorr_bz2.c
137 test_read_format_isorr_ce.c
138 test_read_format_isorr_new_bz2.c
139 test_read_format_isorr_rr_moved.c
140 test_read_format_isozisofs_bz2.c
141 test_read_format_lha.c
142 test_read_format_lha_bugfix_0.c
143 test_read_format_lha_filename.c
144 test_read_format_mtree.c
145 test_read_format_mtree_crash747.c
146 test_read_format_pax_bz2.c
147 test_read_format_rar.c
148 test_read_format_rar_encryption_data.c
149 test_read_format_rar_encryption_header.c
150 test_read_format_rar_encryption_partially.c
151 test_read_format_rar_invalid1.c
152 test_read_format_rar5.c
153 test_read_format_raw.c
154 test_read_format_tar.c
155 test_read_format_tar_concatenated.c
156 test_read_format_tar_empty_filename.c
157 test_read_format_tar_empty_pax.c
158 test_read_format_tar_filename.c
159 test_read_format_tbz.c
160 test_read_format_tgz.c
161 test_read_format_tlz.c
162 test_read_format_txz.c
163 test_read_format_tz.c
164 test_read_format_ustar_filename.c
165 test_read_format_warc.c
166 test_read_format_xar.c
167 test_read_format_zip.c
168 test_read_format_zip_comment_stored.c
169 test_read_format_zip_encryption_data.c
170 test_read_format_zip_encryption_header.c
171 test_read_format_zip_encryption_partially.c
172 test_read_format_zip_filename.c
173 test_read_format_zip_high_compression.c
174 test_read_format_zip_jar.c
175 test_read_format_zip_mac_metadata.c
176 test_read_format_zip_malformed.c
177 test_read_format_zip_msdos.c
178 test_read_format_zip_nested.c
179 test_read_format_zip_nofiletype.c
180 test_read_format_zip_padded.c
181 test_read_format_zip_sfx.c
182 test_read_format_zip_traditional_encryption_data.c
183 test_read_format_zip_winzip_aes.c
184 test_read_format_zip_winzip_aes_large.c
185 test_read_format_zip_zip64.c
186 test_read_format_zip_with_invalid_traditional_eocd.c
188 test_read_pax_schily_xattr.c
189 test_read_pax_truncated.c
191 test_read_set_format.c
192 test_read_too_many_filters.c
193 test_read_truncated.c
194 test_read_truncated_filter.c
198 test_ustar_filename_encoding.c
199 test_ustar_filenames.c
200 test_warn_missing_hardlink_target.c
202 test_write_disk_appledouble.c
203 test_write_disk_failures.c
204 test_write_disk_hardlink.c
205 test_write_disk_hfs_compression.c
206 test_write_disk_lookup.c
207 test_write_disk_mac_metadata.c
208 test_write_disk_no_hfs_compression.c
209 test_write_disk_perms.c
210 test_write_disk_secure.c
211 test_write_disk_secure744.c
212 test_write_disk_secure745.c
213 test_write_disk_secure746.c
214 test_write_disk_sparse.c
215 test_write_disk_symlink.c
216 test_write_disk_times.c
217 test_write_filter_b64encode.c
218 test_write_filter_bzip2.c
219 test_write_filter_compress.c
220 test_write_filter_gzip.c
221 test_write_filter_gzip_timestamp.c
222 test_write_filter_lrzip.c
223 test_write_filter_lz4.c
224 test_write_filter_lzip.c
225 test_write_filter_lzma.c
226 test_write_filter_lzop.c
227 test_write_filter_program.c
228 test_write_filter_uuencode.c
229 test_write_filter_xz.c
230 test_write_filter_zstd.c
231 test_write_format_7zip.c
232 test_write_format_7zip_empty.c
233 test_write_format_7zip_large.c
234 test_write_format_ar.c
235 test_write_format_cpio.c
236 test_write_format_cpio_empty.c
237 test_write_format_cpio_newc.c
238 test_write_format_cpio_odc.c
239 test_write_format_gnutar.c
240 test_write_format_gnutar_filenames.c
241 test_write_format_iso9660.c
242 test_write_format_iso9660_boot.c
243 test_write_format_iso9660_empty.c
244 test_write_format_iso9660_filename.c
245 test_write_format_iso9660_zisofs.c
246 test_write_format_mtree.c
247 test_write_format_mtree_absolute_path.c
248 test_write_format_mtree_classic.c
249 test_write_format_mtree_classic_indent.c
250 test_write_format_mtree_fflags.c
251 test_write_format_mtree_no_separator.c
252 test_write_format_mtree_quoted_filename.c
253 test_write_format_pax.c
254 test_write_format_raw.c
255 test_write_format_raw_b64.c
256 test_write_format_shar_empty.c
257 test_write_format_tar.c
258 test_write_format_tar_empty.c
259 test_write_format_tar_sparse.c
260 test_write_format_tar_ustar.c
261 test_write_format_tar_v7tar.c
262 test_write_format_warc.c
263 test_write_format_warc_empty.c
264 test_write_format_xar.c
265 test_write_format_xar_empty.c
266 test_write_format_zip.c
267 test_write_format_zip_compression_store.c
268 test_write_format_zip_empty.c
269 test_write_format_zip_empty_zip64.c
270 test_write_format_zip_file.c
271 test_write_format_zip_file_zip64.c
272 test_write_format_zip_large.c
273 test_write_format_zip_zip64.c
274 test_write_open_memory.c
275 test_write_read_format_zip.c
276 test_xattr_platform.c
277 test_zip_filename_encoding.c
283 ADD_EXECUTABLE(libarchive_test ${libarchive_test_SOURCES})
284 TARGET_LINK_LIBRARIES(libarchive_test archive_static ${ADDITIONAL_LIBS})
285 SET_PROPERTY(TARGET libarchive_test PROPERTY COMPILE_DEFINITIONS
286 LIBARCHIVE_STATIC LIST_H)
289 # Generate list.h by grepping DEFINE_TEST() lines out of the C sources.
291 GENERATE_LIST_H(${CMAKE_CURRENT_BINARY_DIR}/list.h
292 ${CMAKE_CURRENT_LIST_FILE} ${libarchive_test_SOURCES})
293 SET_PROPERTY(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
294 ${CMAKE_CURRENT_BINARY_DIR})
296 # list.h has a line DEFINE_TEST(testname) for every
297 # test. We can use that to define the tests for cmake by
298 # defining a DEFINE_TEST macro and reading list.h in.
299 MACRO (DEFINE_TEST _testname)
301 NAME libarchive_${_testname}
302 COMMAND libarchive_test -vv
303 -r ${CMAKE_CURRENT_SOURCE_DIR}
305 ENDMACRO (DEFINE_TEST _testname)
307 INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
308 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
309 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/test_utils)
310 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libarchive/test)
312 # Experimental new test handling
313 ADD_CUSTOM_TARGET(run_libarchive_test
314 COMMAND libarchive_test -r ${CMAKE_CURRENT_SOURCE_DIR} -vv)
315 ADD_DEPENDENCIES(run_all_tests run_libarchive_test)