1
############################################
3
# How to build libarchive_test
5
############################################
7
FOREACH (_src ${libarchive_SOURCES})
8
LIST(APPEND parent_libarchive_SOURCES "../${_src}")
11
SET(libarchive_test_SOURCES
12
${parent_libarchive_SOURCES}
19
test_archive_api_feature.c
26
test_compat_solaris_tar_acl.c
27
test_compat_tar_hardlink.c
33
test_extattr_freebsd.c
39
test_pax_filename_encoding.c
40
test_read_compress_program.c
41
test_read_data_large.c
43
test_read_disk_entry_from_file.c
45
test_read_file_nonexistent.c
47
test_read_format_cpio_bin.c
48
test_read_format_cpio_bin_Z.c
49
test_read_format_cpio_bin_be.c
50
test_read_format_cpio_bin_bz2.c
51
test_read_format_cpio_bin_gz.c
52
test_read_format_cpio_bin_lzma.c
53
test_read_format_cpio_bin_xz.c
54
test_read_format_cpio_odc.c
55
test_read_format_cpio_svr4_bzip2_rpm.c
56
test_read_format_cpio_svr4_gzip.c
57
test_read_format_cpio_svr4_gzip_rpm.c
58
test_read_format_cpio_svr4c_Z.c
59
test_read_format_empty.c
60
test_read_format_gtar_gz.c
61
test_read_format_gtar_lzma.c
62
test_read_format_gtar_sparse.c
63
test_read_format_iso_gz.c
64
test_read_format_iso_multi_extent.c
65
test_read_format_isojoliet_bz2.c
66
test_read_format_isojoliet_long.c
67
test_read_format_isojoliet_rr.c
68
test_read_format_isorr_bz2.c
69
test_read_format_isorr_ce.c
70
test_read_format_isorr_new_bz2.c
71
test_read_format_isorr_rr_moved.c
72
test_read_format_isozisofs_bz2.c
73
test_read_format_mtree.c
74
test_read_format_pax_bz2.c
75
test_read_format_raw.c
76
test_read_format_tar.c
77
test_read_format_tar_empty_filename.c
78
test_read_format_tbz.c
79
test_read_format_tgz.c
80
test_read_format_tlz.c
81
test_read_format_txz.c
83
test_read_format_xar.c
84
test_read_format_zip.c
86
test_read_pax_truncated.c
92
test_ustar_filenames.c
94
test_write_compress_bzip2.c
95
test_write_compress_gzip.c
96
test_write_compress_lzma.c
97
test_write_compress_program.c
98
test_write_compress_xz.c
100
test_write_disk_failures.c
101
test_write_disk_hardlink.c
102
test_write_disk_perms.c
103
test_write_disk_secure.c
104
test_write_disk_sparse.c
105
test_write_disk_symlink.c
106
test_write_disk_times.c
107
test_write_format_ar.c
108
test_write_format_cpio.c
109
test_write_format_cpio_empty.c
110
test_write_format_cpio_odc.c
111
test_write_format_cpio_newc.c
112
test_write_format_mtree.c
113
test_write_format_pax.c
114
test_write_format_shar_empty.c
115
test_write_format_tar.c
116
test_write_format_tar_empty.c
117
test_write_format_tar_ustar.c
118
test_write_format_zip.c
119
test_write_format_zip_empty.c
120
test_write_format_zip_no_compression.c
121
test_write_open_memory.c
127
ADD_EXECUTABLE(libarchive_test ${libarchive_test_SOURCES})
128
TARGET_LINK_LIBRARIES(libarchive_test ${ADDITIONAL_LIBS})
129
SET_PROPERTY(TARGET libarchive_test PROPERTY COMPILE_DEFINITIONS
130
LIBARCHIVE_STATIC LIST_H)
133
# Generate list.h by grepping DEFINE_TEST() lines out of the C sources.
135
GENERATE_LIST_H(${CMAKE_CURRENT_BINARY_DIR}/list.h
136
${CMAKE_CURRENT_LIST_FILE} ${libarchive_test_SOURCES})
137
SET_PROPERTY(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
138
${CMAKE_CURRENT_BINARY_DIR})
140
# list.h has a line DEFINE_TEST(testname) for every
141
# test. We can use that to define the tests for cmake by
142
# defining a DEFINE_TEST macro and reading list.h in.
143
MACRO (DEFINE_TEST _testname)
145
NAME libarchive_${_testname}
146
COMMAND libarchive_test -vv
147
-r ${CMAKE_CURRENT_SOURCE_DIR}
149
ENDMACRO (DEFINE_TEST _testname)
151
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
153
# Experimental new test handling
154
ADD_CUSTOM_TARGET(run_libarchive_test
155
COMMAND libarchive_test -r ${CMAKE_CURRENT_SOURCE_DIR})
156
ADD_DEPENDENCIES(run_all_tests run_libarchive_test)