1# $FreeBSD$ 2 3_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive 4 5ATF_TESTS_SH+= functional_test 6 7BINDIR= ${TESTSDIR} 8 9PROGS+= libarchive_test 10 11CFLAGS+= -I${.CURDIR:H} -I${.OBJDIR} 12CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive -I${_LIBARCHIVEDIR}/test_utils 13CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 14 15# Uncomment to link against dmalloc 16#LDADD+= -L/usr/local/lib -ldmalloc 17#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC 18 19.PATH: ${_LIBARCHIVEDIR}/libarchive/test 20TESTS_SRCS= \ 21 test_acl_freebsd_nfs4.c \ 22 test_acl_freebsd_posix1e.c \ 23 test_acl_nfs4.c \ 24 test_acl_pax.c \ 25 test_acl_posix1e.c \ 26 test_archive_api_feature.c \ 27 test_archive_clear_error.c \ 28 test_archive_cmdline.c \ 29 test_archive_crypto.c \ 30 test_archive_getdate.c \ 31 test_archive_match_time.c \ 32 test_archive_match_owner.c \ 33 test_archive_match_path.c \ 34 test_archive_pathmatch.c \ 35 test_archive_read_close_twice.c \ 36 test_archive_read_close_twice_open_fd.c \ 37 test_archive_read_close_twice_open_filename.c \ 38 test_archive_read_multiple_data_objects.c \ 39 test_archive_read_next_header_empty.c \ 40 test_archive_read_next_header_raw.c \ 41 test_archive_read_open2.c \ 42 test_archive_read_set_filter_option.c \ 43 test_archive_read_set_format_option.c \ 44 test_archive_read_set_option.c \ 45 test_archive_read_set_options.c \ 46 test_archive_read_support.c \ 47 test_archive_set_error.c \ 48 test_archive_string.c \ 49 test_archive_string_conversion.c \ 50 test_archive_write_add_filter_by_name.c \ 51 test_archive_write_set_filter_option.c \ 52 test_archive_write_set_format_by_name.c \ 53 test_archive_write_set_format_option.c \ 54 test_archive_write_set_option.c \ 55 test_archive_write_set_options.c \ 56 test_bad_fd.c \ 57 test_compat_bzip2.c \ 58 test_compat_cpio.c \ 59 test_compat_gtar.c \ 60 test_compat_gzip.c \ 61 test_compat_lzip.c \ 62 test_compat_lzma.c \ 63 test_compat_lzop.c \ 64 test_compat_mac.c \ 65 test_compat_pax_libarchive_2x.c \ 66 test_compat_solaris_tar_acl.c \ 67 test_compat_solaris_pax_sparse.c \ 68 test_compat_tar_hardlink.c \ 69 test_compat_uudecode.c \ 70 test_compat_xz.c \ 71 test_compat_zip.c \ 72 test_empty_write.c \ 73 test_entry.c \ 74 test_entry_strmode.c \ 75 test_extattr_freebsd.c \ 76 test_filter_count.c \ 77 test_fuzz.c \ 78 test_gnutar_filename_encoding.c \ 79 test_link_resolver.c \ 80 test_open_fd.c \ 81 test_open_failure.c \ 82 test_open_file.c \ 83 test_open_filename.c \ 84 test_pax_filename_encoding.c \ 85 test_read_data_large.c \ 86 test_read_disk.c \ 87 test_read_disk_directory_traversals.c \ 88 test_read_disk_entry_from_file.c \ 89 test_read_extract.c \ 90 test_read_file_nonexistent.c \ 91 test_read_filter_grzip.c \ 92 test_read_filter_lrzip.c \ 93 test_read_filter_lzop.c \ 94 test_read_filter_lzop_multiple_parts.c \ 95 test_read_filter_program.c \ 96 test_read_filter_program_signature.c \ 97 test_read_filter_uudecode.c \ 98 test_read_format_7zip.c \ 99 test_read_format_ar.c \ 100 test_read_format_cab.c \ 101 test_read_format_cab_filename.c \ 102 test_read_format_cpio_afio.c \ 103 test_read_format_cpio_bin.c \ 104 test_read_format_cpio_bin_Z.c \ 105 test_read_format_cpio_bin_be.c \ 106 test_read_format_cpio_bin_bz2.c \ 107 test_read_format_cpio_bin_gz.c \ 108 test_read_format_cpio_bin_lzip.c \ 109 test_read_format_cpio_bin_lzma.c \ 110 test_read_format_cpio_bin_xz.c \ 111 test_read_format_cpio_filename.c \ 112 test_read_format_cpio_odc.c \ 113 test_read_format_cpio_svr4_gzip.c \ 114 test_read_format_cpio_svr4c_Z.c \ 115 test_read_format_cpio_svr4_bzip2_rpm.c \ 116 test_read_format_cpio_svr4_gzip_rpm.c \ 117 test_read_format_empty.c \ 118 test_read_format_gtar_filename.c \ 119 test_read_format_gtar_gz.c \ 120 test_read_format_gtar_lzma.c \ 121 test_read_format_gtar_sparse.c \ 122 test_read_format_gtar_sparse_skip_entry.c \ 123 test_read_format_iso_Z.c \ 124 test_read_format_iso_multi_extent.c \ 125 test_read_format_iso_xorriso.c \ 126 test_read_format_isorr_rr_moved.c \ 127 test_read_format_isojoliet_bz2.c \ 128 test_read_format_isojoliet_long.c \ 129 test_read_format_isojoliet_rr.c \ 130 test_read_format_isojoliet_versioned.c \ 131 test_read_format_isorr_bz2.c \ 132 test_read_format_isorr_ce.c \ 133 test_read_format_isorr_new_bz2.c \ 134 test_read_format_isozisofs_bz2.c \ 135 test_read_format_lha.c \ 136 test_read_format_lha_filename.c \ 137 test_read_format_mtree.c \ 138 test_read_format_pax_bz2.c \ 139 test_read_format_rar.c \ 140 test_read_format_raw.c \ 141 test_read_format_tar.c \ 142 test_read_format_tar_empty_filename.c \ 143 test_read_format_tar_filename.c \ 144 test_read_format_tbz.c \ 145 test_read_format_tgz.c \ 146 test_read_format_tlz.c \ 147 test_read_format_txz.c \ 148 test_read_format_tz.c \ 149 test_read_format_ustar_filename.c \ 150 test_read_format_xar.c \ 151 test_read_format_zip.c \ 152 test_read_format_zip_comment_stored.c \ 153 test_read_format_zip_filename.c \ 154 test_read_format_zip_mac_metadata.c \ 155 test_read_format_zip_sfx.c \ 156 test_read_large.c \ 157 test_read_pax_truncated.c \ 158 test_read_position.c \ 159 test_read_set_format.c \ 160 test_read_truncated.c \ 161 test_read_truncated_filter.c \ 162 test_sparse_basic.c \ 163 test_tar_filenames.c \ 164 test_tar_large.c \ 165 test_ustar_filenames.c \ 166 test_ustar_filename_encoding.c \ 167 test_write_disk.c \ 168 test_write_disk_appledouble.c \ 169 test_write_disk_failures.c \ 170 test_write_disk_hardlink.c \ 171 test_write_disk_hfs_compression.c \ 172 test_write_disk_lookup.c \ 173 test_write_disk_mac_metadata.c \ 174 test_write_disk_no_hfs_compression.c \ 175 test_write_disk_perms.c \ 176 test_write_disk_secure.c \ 177 test_write_disk_sparse.c \ 178 test_write_disk_symlink.c \ 179 test_write_disk_times.c \ 180 test_write_filter_b64encode.c \ 181 test_write_filter_bzip2.c \ 182 test_write_filter_compress.c \ 183 test_write_filter_gzip.c \ 184 test_write_filter_gzip_timestamp.c \ 185 test_write_filter_lrzip.c \ 186 test_write_filter_lzip.c \ 187 test_write_filter_lzma.c \ 188 test_write_filter_lzop.c \ 189 test_write_filter_program.c \ 190 test_write_filter_uuencode.c \ 191 test_write_filter_xz.c \ 192 test_write_format_7zip.c \ 193 test_write_format_7zip_empty.c \ 194 test_write_format_7zip_large.c \ 195 test_write_format_ar.c \ 196 test_write_format_cpio.c \ 197 test_write_format_cpio_empty.c \ 198 test_write_format_cpio_newc.c \ 199 test_write_format_cpio_odc.c \ 200 test_write_format_gnutar.c \ 201 test_write_format_iso9660.c \ 202 test_write_format_iso9660_boot.c \ 203 test_write_format_iso9660_empty.c \ 204 test_write_format_iso9660_filename.c \ 205 test_write_format_iso9660_zisofs.c \ 206 test_write_format_mtree.c \ 207 test_write_format_mtree_absolute_path.c \ 208 test_write_format_mtree_classic.c \ 209 test_write_format_mtree_classic_indent.c \ 210 test_write_format_mtree_fflags.c \ 211 test_write_format_mtree_no_separator.c \ 212 test_write_format_mtree_quoted_filename.c \ 213 test_write_format_pax.c \ 214 test_write_format_shar_empty.c \ 215 test_write_format_tar.c \ 216 test_write_format_tar_empty.c \ 217 test_write_format_tar_sparse.c \ 218 test_write_format_tar_ustar.c \ 219 test_write_format_tar_v7tar.c \ 220 test_write_format_xar.c \ 221 test_write_format_xar_empty.c \ 222 test_write_format_zip.c \ 223 test_write_format_zip_empty.c \ 224 test_write_format_zip_no_compression.c \ 225 test_write_zip_set_compression_store.c \ 226 test_write_open_memory.c \ 227 test_zip_filename_encoding.c 228 229# Deterministic failures: 230# Crashes with SIGBUS 231BROKEN_TESTS+= test_archive_rmd160 232# Fails with `libarchive/test/test_archive_crypto.c:121: md != actualmd` 233BROKEN_TESTS+= test_archive_sha384 234# Fails with `test_compat_pax_libarchive_2x.c:122: ARCHIVE_WARN != archive_read_next_header(a, &ae)` 235BROKEN_TESTS+= test_compat_pax_libarchive_2x 236# Fails with `test_read_disk_directory_traversals.c:1094: File at has atime 886622, 1443306049 seconds ago` 237BROKEN_TESTS+= test_read_disk_directory_traversals 238 239# Non-deterministic failures: 240# (Times out?) [and] crashes 241BROKEN_TESTS+= test_fuzz_rar 242 243# Build the test program. 244SRCS.libarchive_test= \ 245 ${TESTS_SRCS} \ 246 main.c \ 247 read_open_memory.c \ 248 list.h 249 250LIBADD.libarchive_test= archive 251 252.PATH: ${_LIBARCHIVEDIR}/test_utils 253SRCS.libarchive_test+= test_utils.c 254 255# list.h is just a list of all tests, as indicated by DEFINE_TEST macro lines 256list.h: ${TESTS_SRCS} Makefile 257 @(cd ${_LIBARCHIVEDIR}/libarchive/test && \ 258 grep -h DEFINE_TEST ${.ALLSRC:N*Makefile} | \ 259 egrep -v '${BROKEN_TESTS:tW:C/ /|/g}') > ${.TARGET}.tmp 260 @mv ${.TARGET}.tmp ${.TARGET} 261 262CLEANFILES+= list.h list.h.tmp 263 264FILES+= README 265FILES+= test_acl_pax.tar.uu 266FILES+= test_archive_string_conversion.txt.Z.uu 267FILES+= test_compat_bzip2_1.tbz.uu 268FILES+= test_compat_bzip2_2.tbz.uu 269FILES+= test_compat_cpio_1.cpio.uu 270FILES+= test_compat_gtar_1.tar.uu 271FILES+= test_compat_gzip_1.tgz.uu 272FILES+= test_compat_gzip_2.tgz.uu 273FILES+= test_compat_lzip_1.tlz.uu 274FILES+= test_compat_lzip_2.tlz.uu 275FILES+= test_compat_lzma_1.tlz.uu 276FILES+= test_compat_lzma_2.tlz.uu 277FILES+= test_compat_lzma_3.tlz.uu 278FILES+= test_compat_lzop_1.tar.lzo.uu 279FILES+= test_compat_lzop_2.tar.lzo.uu 280FILES+= test_compat_lzop_3.tar.lzo.uu 281FILES+= test_compat_mac-1.tar.Z.uu 282FILES+= test_compat_mac-2.tar.Z.uu 283FILES+= test_compat_pax_libarchive_2x.tar.Z.uu 284FILES+= test_compat_solaris_pax_sparse_1.pax.Z.uu 285FILES+= test_compat_solaris_pax_sparse_2.pax.Z.uu 286FILES+= test_compat_solaris_tar_acl.tar.uu 287FILES+= test_compat_tar_hardlink_1.tar.uu 288FILES+= test_compat_xz_1.txz.uu 289FILES+= test_compat_zip_1.zip.uu 290FILES+= test_compat_zip_2.zip.uu 291FILES+= test_compat_zip_3.zip.uu 292FILES+= test_compat_zip_4.zip.uu 293FILES+= test_compat_zip_5.zip.uu 294FILES+= test_compat_zip_6.zip.uu 295FILES+= test_compat_zip_7.xps.uu 296FILES+= test_fuzz.cab.uu 297FILES+= test_fuzz.lzh.uu 298FILES+= test_fuzz_1.iso.Z.uu 299FILES+= test_pax_filename_encoding.tar.uu 300FILES+= test_rar_multivolume_multiple_files.part1.rar.uu 301FILES+= test_rar_multivolume_multiple_files.part2.rar.uu 302FILES+= test_rar_multivolume_multiple_files.part3.rar.uu 303FILES+= test_rar_multivolume_multiple_files.part4.rar.uu 304FILES+= test_rar_multivolume_multiple_files.part5.rar.uu 305FILES+= test_rar_multivolume_multiple_files.part6.rar.uu 306FILES+= test_rar_multivolume_single_file.part1.rar.uu 307FILES+= test_rar_multivolume_single_file.part2.rar.uu 308FILES+= test_rar_multivolume_single_file.part3.rar.uu 309FILES+= test_rar_multivolume_uncompressed_files.part01.rar.uu 310FILES+= test_rar_multivolume_uncompressed_files.part02.rar.uu 311FILES+= test_rar_multivolume_uncompressed_files.part03.rar.uu 312FILES+= test_rar_multivolume_uncompressed_files.part04.rar.uu 313FILES+= test_rar_multivolume_uncompressed_files.part05.rar.uu 314FILES+= test_rar_multivolume_uncompressed_files.part06.rar.uu 315FILES+= test_rar_multivolume_uncompressed_files.part07.rar.uu 316FILES+= test_rar_multivolume_uncompressed_files.part08.rar.uu 317FILES+= test_rar_multivolume_uncompressed_files.part09.rar.uu 318FILES+= test_rar_multivolume_uncompressed_files.part10.rar.uu 319FILES+= test_read_filter_grzip.tar.grz.uu 320FILES+= test_read_filter_lrzip.tar.lrz.uu 321FILES+= test_read_filter_lzop.tar.lzo.uu 322FILES+= test_read_filter_lzop_multiple_parts.tar.lzo.uu 323FILES+= test_read_format_7zip_bcj2_bzip2.7z.uu 324FILES+= test_read_format_7zip_bcj2_copy_1.7z.uu 325FILES+= test_read_format_7zip_bcj2_copy_2.7z.uu 326FILES+= test_read_format_7zip_bcj2_copy_lzma.7z.uu 327FILES+= test_read_format_7zip_bcj2_deflate.7z.uu 328FILES+= test_read_format_7zip_bcj2_lzma1_1.7z.uu 329FILES+= test_read_format_7zip_bcj2_lzma1_2.7z.uu 330FILES+= test_read_format_7zip_bcj2_lzma2_1.7z.uu 331FILES+= test_read_format_7zip_bcj2_lzma2_2.7z.uu 332FILES+= test_read_format_7zip_bcj_bzip2.7z.uu 333FILES+= test_read_format_7zip_bcj_copy.7z.uu 334FILES+= test_read_format_7zip_bcj_deflate.7z.uu 335FILES+= test_read_format_7zip_bcj_lzma1.7z.uu 336FILES+= test_read_format_7zip_bcj_lzma2.7z.uu 337FILES+= test_read_format_7zip_bzip2.7z.uu 338FILES+= test_read_format_7zip_copy.7z.uu 339FILES+= test_read_format_7zip_copy_2.7z.uu 340FILES+= test_read_format_7zip_deflate.7z.uu 341FILES+= test_read_format_7zip_delta_lzma1.7z.uu 342FILES+= test_read_format_7zip_delta_lzma2.7z.uu 343FILES+= test_read_format_7zip_empty_archive.7z.uu 344FILES+= test_read_format_7zip_empty_file.7z.uu 345FILES+= test_read_format_7zip_lzma1.7z.uu 346FILES+= test_read_format_7zip_lzma1_2.7z.uu 347FILES+= test_read_format_7zip_lzma1_lzma2.7z.uu 348FILES+= test_read_format_7zip_lzma2.7z.uu 349FILES+= test_read_format_7zip_ppmd.7z.uu 350FILES+= test_read_format_7zip_symbolic_name.7z.uu 351FILES+= test_read_format_ar.ar.uu 352FILES+= test_read_format_cab_1.cab.uu 353FILES+= test_read_format_cab_2.cab.uu 354FILES+= test_read_format_cab_3.cab.uu 355FILES+= test_read_format_cab_filename_cp932.cab.uu 356FILES+= test_read_format_cpio_bin_be.cpio.uu 357FILES+= test_read_format_cpio_filename_cp866.cpio.uu 358FILES+= test_read_format_cpio_filename_eucjp.cpio.uu 359FILES+= test_read_format_cpio_filename_koi8r.cpio.uu 360FILES+= test_read_format_cpio_filename_utf8_jp.cpio.uu 361FILES+= test_read_format_cpio_filename_utf8_ru.cpio.uu 362FILES+= test_read_format_cpio_svr4_bzip2_rpm.rpm.uu 363FILES+= test_read_format_cpio_svr4_gzip_rpm.rpm.uu 364FILES+= test_read_format_gtar_filename_cp866.tar.Z.uu 365FILES+= test_read_format_gtar_filename_eucjp.tar.Z.uu 366FILES+= test_read_format_gtar_filename_koi8r.tar.Z.uu 367FILES+= test_read_format_gtar_sparse_1_13.tar.uu 368FILES+= test_read_format_gtar_sparse_1_17.tar.uu 369FILES+= test_read_format_gtar_sparse_1_17_posix00.tar.uu 370FILES+= test_read_format_gtar_sparse_1_17_posix01.tar.uu 371FILES+= test_read_format_gtar_sparse_1_17_posix10.tar.uu 372FILES+= test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu 373FILES+= test_read_format_gtar_sparse_skip_entry.tar.Z.uu 374FILES+= test_read_format_iso.iso.Z.uu 375FILES+= test_read_format_iso_2.iso.Z.uu 376FILES+= test_read_format_iso_joliet.iso.Z.uu 377FILES+= test_read_format_iso_joliet_by_nero.iso.Z.uu 378FILES+= test_read_format_iso_joliet_long.iso.Z.uu 379FILES+= test_read_format_iso_joliet_rockridge.iso.Z.uu 380FILES+= test_read_format_iso_multi_extent.iso.Z.uu 381FILES+= test_read_format_iso_rockridge.iso.Z.uu 382FILES+= test_read_format_iso_rockridge_ce.iso.Z.uu 383FILES+= test_read_format_iso_rockridge_new.iso.Z.uu 384FILES+= test_read_format_iso_rockridge_rr_moved.iso.Z.uu 385FILES+= test_read_format_iso_xorriso.iso.Z.uu 386FILES+= test_read_format_iso_zisofs.iso.Z.uu 387FILES+= test_read_format_lha_filename_cp932.lzh.uu 388FILES+= test_read_format_lha_header0.lzh.uu 389FILES+= test_read_format_lha_header1.lzh.uu 390FILES+= test_read_format_lha_header2.lzh.uu 391FILES+= test_read_format_lha_header3.lzh.uu 392FILES+= test_read_format_lha_lh0.lzh.uu 393FILES+= test_read_format_lha_lh6.lzh.uu 394FILES+= test_read_format_lha_lh7.lzh.uu 395FILES+= test_read_format_lha_withjunk.lzh.uu 396FILES+= test_read_format_mtree.mtree.uu 397FILES+= test_read_format_mtree_nomagic.mtree.uu 398FILES+= test_read_format_mtree_nomagic2.mtree.uu 399FILES+= test_read_format_mtree_nomagic3.mtree.uu 400FILES+= test_read_format_rar.rar.uu 401FILES+= test_read_format_rar_binary_data.rar.uu 402FILES+= test_read_format_rar_compress_best.rar.uu 403FILES+= test_read_format_rar_compress_normal.rar.uu 404FILES+= test_read_format_rar_multi_lzss_blocks.rar.uu 405FILES+= test_read_format_rar_multivolume.part0001.rar.uu 406FILES+= test_read_format_rar_multivolume.part0002.rar.uu 407FILES+= test_read_format_rar_multivolume.part0003.rar.uu 408FILES+= test_read_format_rar_multivolume.part0004.rar.uu 409FILES+= test_read_format_rar_noeof.rar.uu 410FILES+= test_read_format_rar_ppmd_lzss_conversion.rar.uu 411FILES+= test_read_format_rar_sfx.exe.uu 412FILES+= test_read_format_rar_subblock.rar.uu 413FILES+= test_read_format_rar_unicode.rar.uu 414FILES+= test_read_format_rar_windows.rar.uu 415FILES+= test_read_format_raw.data.Z.uu 416FILES+= test_read_format_raw.data.uu 417FILES+= test_read_format_tar_empty_filename.tar.uu 418FILES+= test_read_format_tar_filename_koi8r.tar.Z.uu 419FILES+= test_read_format_ustar_filename_cp866.tar.Z.uu 420FILES+= test_read_format_ustar_filename_eucjp.tar.Z.uu 421FILES+= test_read_format_ustar_filename_koi8r.tar.Z.uu 422FILES+= test_read_format_zip.zip.uu 423FILES+= test_read_format_zip_comment_stored_1.zip.uu 424FILES+= test_read_format_zip_comment_stored_2.zip.uu 425FILES+= test_read_format_zip_filename_cp866.zip.uu 426FILES+= test_read_format_zip_filename_cp932.zip.uu 427FILES+= test_read_format_zip_filename_koi8r.zip.uu 428FILES+= test_read_format_zip_filename_utf8_jp.zip.uu 429FILES+= test_read_format_zip_filename_utf8_ru.zip.uu 430FILES+= test_read_format_zip_filename_utf8_ru2.zip.uu 431FILES+= test_read_format_zip_length_at_end.zip.uu 432FILES+= test_read_format_zip_mac_metadata.zip.uu 433FILES+= test_read_format_zip_sfx.uu 434FILES+= test_read_format_zip_symlink.zip.uu 435FILES+= test_read_format_zip_ux.zip.uu 436FILES+= test_read_large_splitted_rar_aa.uu 437FILES+= test_read_large_splitted_rar_ab.uu 438FILES+= test_read_large_splitted_rar_ac.uu 439FILES+= test_read_large_splitted_rar_ad.uu 440FILES+= test_read_large_splitted_rar_ae.uu 441FILES+= test_read_splitted_rar_aa.uu 442FILES+= test_read_splitted_rar_ab.uu 443FILES+= test_read_splitted_rar_ac.uu 444FILES+= test_read_splitted_rar_ad.uu 445FILES+= test_splitted_rar_seek_support_aa.uu 446FILES+= test_splitted_rar_seek_support_ab.uu 447FILES+= test_splitted_rar_seek_support_ac.uu 448FILES+= test_write_disk_appledouble.cpio.gz.uu 449FILES+= test_write_disk_hfs_compression.tgz.uu 450FILES+= test_write_disk_mac_metadata.tar.gz.uu 451FILES+= test_write_disk_no_hfs_compression.tgz.uu 452 453.include <bsd.test.mk> 454