Files
mars-nwe/tests/afp/CMakeLists.txt
ai 92b0c4a34a
All checks were successful
Source release / source-package (push) Successful in 55s
afp: add deleted file Macintosh info endpoint
2026-06-01 11:07:43 +02:00

97 lines
3.8 KiB
CMake

# Optional AFP integration smoke tests.
#
# These helpers are not built by default because they depend on the host
# ncpfs/libncp development files and on a running NetWare-compatible server.
find_path(NCPFS_INCLUDE_DIR
NAMES ncp/nwcalls.h ncp/ncplib.h
)
find_library(NCPFS_LIBRARY
NAMES ncp
)
if(NOT NCPFS_INCLUDE_DIR OR NOT NCPFS_LIBRARY)
message(FATAL_ERROR
"MARS_NWE_BUILD_TESTS requires ncpfs/libncp headers and libncp for AFP smoke tests. "
"Install the ncpfs development package or disable MARS_NWE_BUILD_TESTS."
)
endif()
set(AFP_SMOKE_SUITE_SCRIPT
${CMAKE_CURRENT_BINARY_DIR}/afp_smoke_suite.sh
)
add_custom_command(
OUTPUT ${AFP_SMOKE_SUITE_SCRIPT}
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/afp_smoke_suite.sh
${AFP_SMOKE_SUITE_SCRIPT}
COMMAND ${CMAKE_COMMAND} -E env chmod +x ${AFP_SMOKE_SUITE_SCRIPT}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/afp_smoke_suite.sh
COMMENT "Copying AFP smoke-suite helper"
VERBATIM
)
add_custom_target(afp_smoke_suite ALL
DEPENDS ${AFP_SMOKE_SUITE_SCRIPT}
)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES
${AFP_SMOKE_SUITE_SCRIPT}
)
add_executable(afp_entry_id_smoke afp_entry_id_smoke.c)
target_include_directories(afp_entry_id_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_entry_id_smoke ${NCPFS_LIBRARY})
add_executable(afp_file_info_smoke afp_file_info_smoke.c)
target_include_directories(afp_file_info_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_file_info_smoke ${NCPFS_LIBRARY})
add_executable(afp_dos_name_smoke afp_dos_name_smoke.c)
target_include_directories(afp_dos_name_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_dos_name_smoke ${NCPFS_LIBRARY})
add_executable(afp_scan_info_smoke afp_scan_info_smoke.c)
target_include_directories(afp_scan_info_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_scan_info_smoke ${NCPFS_LIBRARY})
add_executable(afp_open_file_fork_smoke afp_open_file_fork_smoke.c)
target_include_directories(afp_open_file_fork_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_open_file_fork_smoke ${NCPFS_LIBRARY})
add_executable(afp_file_fork_io_smoke afp_file_fork_io_smoke.c)
target_include_directories(afp_file_fork_io_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_file_fork_io_smoke ${NCPFS_LIBRARY})
add_executable(afp_create_directory_smoke afp_create_directory_smoke.c)
target_include_directories(afp_create_directory_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_create_directory_smoke ${NCPFS_LIBRARY})
add_executable(afp_create_file_smoke afp_create_file_smoke.c)
target_include_directories(afp_create_file_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_create_file_smoke ${NCPFS_LIBRARY})
add_executable(afp_delete_smoke afp_delete_smoke.c)
target_include_directories(afp_delete_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_delete_smoke ${NCPFS_LIBRARY})
add_executable(afp_deleted_info_smoke afp_deleted_info_smoke.c)
target_include_directories(afp_deleted_info_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_deleted_info_smoke ${NCPFS_LIBRARY})
add_executable(afp_rename_smoke afp_rename_smoke.c)
target_include_directories(afp_rename_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_rename_smoke ${NCPFS_LIBRARY})
add_executable(afp_temp_dir_handle_smoke afp_temp_dir_handle_smoke.c)
target_include_directories(afp_temp_dir_handle_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_temp_dir_handle_smoke ${NCPFS_LIBRARY})
add_executable(afp_set_file_info_smoke afp_set_file_info_smoke.c)
target_include_directories(afp_set_file_info_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_set_file_info_smoke ${NCPFS_LIBRARY})