|
Packit Service |
1d0348 |
############################################
|
|
Packit Service |
1d0348 |
#
|
|
Packit Service |
1d0348 |
# How to build bsdtar_test
|
|
Packit Service |
1d0348 |
#
|
|
Packit Service |
1d0348 |
############################################
|
|
Packit Service |
1d0348 |
IF(ENABLE_TAR AND ENABLE_TEST)
|
|
Packit Service |
1d0348 |
SET(bsdtar_test_SOURCES
|
|
Packit Service |
1d0348 |
../../test_utils/test_utils.c
|
|
Packit Service |
1d0348 |
../../test_utils/test_main.c
|
|
Packit Service |
1d0348 |
test.h
|
|
Packit Service |
1d0348 |
test_0.c
|
|
Packit Service |
1d0348 |
test_basic.c
|
|
Packit Service |
1d0348 |
test_copy.c
|
|
Packit Service |
1d0348 |
test_empty_mtree.c
|
|
Packit Service |
1d0348 |
test_extract_tar_Z.c
|
|
Packit Service |
1d0348 |
test_extract_tar_bz2.c
|
|
Packit Service |
1d0348 |
test_extract_tar_grz.c
|
|
Packit Service |
1d0348 |
test_extract_tar_gz.c
|
|
Packit Service |
1d0348 |
test_extract_tar_lrz.c
|
|
Packit Service |
1d0348 |
test_extract_tar_lz.c
|
|
Packit Service |
1d0348 |
test_extract_tar_lz4.c
|
|
Packit Service |
1d0348 |
test_extract_tar_lzma.c
|
|
Packit Service |
1d0348 |
test_extract_tar_lzo.c
|
|
Packit Service |
1d0348 |
test_extract_tar_xz.c
|
|
Packit Service |
1d0348 |
test_extract_tar_zstd.c
|
|
Packit Service |
1d0348 |
test_format_newc.c
|
|
Packit Service |
1d0348 |
test_help.c
|
|
Packit Service |
1d0348 |
test_leading_slash.c
|
|
Packit Service |
1d0348 |
test_missing_file.c
|
|
Packit Service |
1d0348 |
test_option_C_upper.c
|
|
Packit Service |
1d0348 |
test_option_C_mtree.c
|
|
Packit Service |
1d0348 |
test_option_H_upper.c
|
|
Packit Service |
1d0348 |
test_option_L_upper.c
|
|
Packit Service |
1d0348 |
test_option_O_upper.c
|
|
Packit Service |
1d0348 |
test_option_T_upper.c
|
|
Packit Service |
1d0348 |
test_option_U_upper.c
|
|
Packit Service |
1d0348 |
test_option_X_upper.c
|
|
Packit Service |
1d0348 |
test_option_a.c
|
|
Packit Service |
1d0348 |
test_option_acls.c
|
|
Packit Service |
1d0348 |
test_option_b.c
|
|
Packit Service |
1d0348 |
test_option_b64encode.c
|
|
Packit Service |
1d0348 |
test_option_exclude.c
|
|
Packit Service |
1d0348 |
test_option_fflags.c
|
|
Packit Service |
1d0348 |
test_option_gid_gname.c
|
|
Packit Service |
1d0348 |
test_option_grzip.c
|
|
Packit Service |
1d0348 |
test_option_j.c
|
|
Packit Service |
1d0348 |
test_option_k.c
|
|
Packit Service |
1d0348 |
test_option_keep_newer_files.c
|
|
Packit Service |
1d0348 |
test_option_lrzip.c
|
|
Packit Service |
1d0348 |
test_option_lz4.c
|
|
Packit Service |
1d0348 |
test_option_lzma.c
|
|
Packit Service |
1d0348 |
test_option_lzop.c
|
|
Packit Service |
1d0348 |
test_option_n.c
|
|
Packit Service |
1d0348 |
test_option_newer_than.c
|
|
Packit Service |
1d0348 |
test_option_nodump.c
|
|
Packit Service |
1d0348 |
test_option_older_than.c
|
|
Packit Service |
1d0348 |
test_option_passphrase.c
|
|
Packit Service |
1d0348 |
test_option_q.c
|
|
Packit Service |
1d0348 |
test_option_r.c
|
|
Packit Service |
1d0348 |
test_option_s.c
|
|
Packit Service |
1d0348 |
test_option_uid_uname.c
|
|
Packit Service |
1d0348 |
test_option_uuencode.c
|
|
Packit Service |
1d0348 |
test_option_xattrs.c
|
|
Packit Service |
1d0348 |
test_option_xz.c
|
|
Packit Service |
1d0348 |
test_option_z.c
|
|
Packit Service |
1d0348 |
test_option_zstd.c
|
|
Packit Service |
1d0348 |
test_patterns.c
|
|
Packit Service |
1d0348 |
test_print_longpath.c
|
|
Packit Service |
1d0348 |
test_stdio.c
|
|
Packit Service |
1d0348 |
test_strip_components.c
|
|
Packit Service |
1d0348 |
test_symlink_dir.c
|
|
Packit Service |
1d0348 |
test_version.c
|
|
Packit Service |
1d0348 |
test_windows.c
|
|
Packit Service |
1d0348 |
)
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
#
|
|
Packit Service |
1d0348 |
# Register target
|
|
Packit Service |
1d0348 |
#
|
|
Packit Service |
1d0348 |
ADD_EXECUTABLE(bsdtar_test ${bsdtar_test_SOURCES})
|
|
Packit Service |
1d0348 |
IF(ENABLE_ACL)
|
|
Packit Service |
1d0348 |
SET(TEST_ACL_LIBS "")
|
|
Packit Service |
1d0348 |
IF(HAVE_LIBACL)
|
|
Packit Service |
1d0348 |
LIST(APPEND TEST_ACL_LIBS ${ACL_LIBRARY})
|
|
Packit Service |
1d0348 |
ENDIF(HAVE_LIBACL)
|
|
Packit Service |
1d0348 |
IF(HAVE_LIBRICHACL)
|
|
Packit Service |
1d0348 |
LIST(APPEND TEST_ACL_LIBS ${RICHACL_LIBRARY})
|
|
Packit Service |
1d0348 |
ENDIF(HAVE_LIBRICHACL)
|
|
Packit Service |
1d0348 |
TARGET_LINK_LIBRARIES(bsdtar_test ${TEST_ACL_LIBS})
|
|
Packit Service |
1d0348 |
ENDIF(ENABLE_ACL)
|
|
Packit Service |
1d0348 |
SET_PROPERTY(TARGET bsdtar_test PROPERTY COMPILE_DEFINITIONS LIST_H)
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
#
|
|
Packit Service |
1d0348 |
# Generate list.h by grepping DEFINE_TEST() lines out of the C sources.
|
|
Packit Service |
1d0348 |
#
|
|
Packit Service |
1d0348 |
GENERATE_LIST_H(${CMAKE_CURRENT_BINARY_DIR}/list.h
|
|
Packit Service |
1d0348 |
${CMAKE_CURRENT_LIST_FILE} ${bsdtar_test_SOURCES})
|
|
Packit Service |
1d0348 |
SET_PROPERTY(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
|
|
Packit Service |
1d0348 |
${CMAKE_CURRENT_BINARY_DIR})
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
# list.h has a line DEFINE_TEST(testname) for every
|
|
Packit Service |
1d0348 |
# test. We can use that to define the tests for cmake by
|
|
Packit Service |
1d0348 |
# defining a DEFINE_TEST macro and reading list.h in.
|
|
Packit Service |
1d0348 |
MACRO (DEFINE_TEST _testname)
|
|
Packit Service |
1d0348 |
ADD_TEST(
|
|
Packit Service |
1d0348 |
NAME bsdtar_${_testname}
|
|
Packit Service |
1d0348 |
COMMAND bsdtar_test -vv
|
|
Packit Service |
1d0348 |
-p $<TARGET_FILE:bsdtar>
|
|
Packit Service |
1d0348 |
-r ${CMAKE_CURRENT_SOURCE_DIR}
|
|
Packit Service |
1d0348 |
${_testname})
|
|
Packit Service |
1d0348 |
ENDMACRO (DEFINE_TEST _testname)
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
|
|
Packit Service |
1d0348 |
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
|
Packit Service |
1d0348 |
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/test_utils)
|
|
Packit Service |
1d0348 |
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/tar/test)
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
# Experimental new test handling
|
|
Packit Service |
1d0348 |
ADD_CUSTOM_TARGET(run_bsdtar_test
|
|
Packit Service |
1d0348 |
COMMAND bsdtar_test -p $<TARGET_FILE:bsdtar>
|
|
Packit Service |
1d0348 |
-r ${CMAKE_CURRENT_SOURCE_DIR}
|
|
Packit Service |
1d0348 |
-vv)
|
|
Packit Service |
1d0348 |
ADD_DEPENDENCIES(run_bsdtar_test bsdtar)
|
|
Packit Service |
1d0348 |
ADD_DEPENDENCIES(run_all_tests run_bsdtar_test)
|
|
Packit Service |
1d0348 |
|
|
Packit Service |
1d0348 |
ENDIF(ENABLE_TAR AND ENABLE_TEST)
|