Tests: Check symlinks to directories in RunCMake.CPackSymlinks

Regression test for issue #21886
This commit is contained in:
Olivier Iffrig
2021-03-05 18:41:23 +00:00
parent 15610d42fe
commit f42b048b9c
4 changed files with 25 additions and 4 deletions

View File

@@ -15,6 +15,7 @@ function(run_cpack_symlink_test)
run_cmake_command(SrcSymlinksCPack
${CMAKE_CPACK_COMMAND} --config CPackSourceConfig.cmake
)
run_cmake_script(SrcSymlinksCheck)
endfunction()
run_cpack_symlink_test()

View File

@@ -0,0 +1,21 @@
set(dir ${CMAKE_CURRENT_SOURCE_DIR})
set(tarball ${dir}/SrcSymlinks-0.1-Source.tar.gz)
set(extrdir ${dir}/SrcSymlinks-0.1-Source)
message(STATUS "Extracting ${tarball} in ${dir}...")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ${tarball}
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE output
WORKING_DIRECTORY ${dir})
message(STATUS "result='${result}'")
message(STATUS "output='${output}'")
if(NOT ${result} EQUAL 0)
message(FATAL_ERROR "Cannot unpack source tarball")
endif()
if(NOT EXISTS ${extrdir}/dirlink/src.h)
message(FATAL_ERROR "${extrdir}/dirlink/src.h not found")
endif()

View File

@@ -1,7 +1,6 @@
^x CMakeLists.txt
x cygwin/
x cygwin/build.sh
x cygwin/setup.patch
^x build.sh
x CMakeLists.txt
x dirlink
x include/
x include/src.h
x link.h