diff options
author | Olivier Iffrig <olivier.iffrig@ecmwf.int> | 2021-03-05 18:41:23 (GMT) |
---|---|---|
committer | Olivier Iffrig <olivier.iffrig@ecmwf.int> | 2021-03-10 17:39:55 (GMT) |
commit | f42b048b9ca35d8637de6caa2bc6dad8904793dc (patch) | |
tree | c0fa0c476405d0f73b73b1806734f84a614d7f5a /Tests/RunCMake/CPackSymlinks | |
parent | 15610d42fee8d2a6db1ad4be0d681be7f7f178c9 (diff) | |
download | CMake-f42b048b9ca35d8637de6caa2bc6dad8904793dc.zip CMake-f42b048b9ca35d8637de6caa2bc6dad8904793dc.tar.gz CMake-f42b048b9ca35d8637de6caa2bc6dad8904793dc.tar.bz2 |
Tests: Check symlinks to directories in RunCMake.CPackSymlinks
Regression test for issue #21886
Diffstat (limited to 'Tests/RunCMake/CPackSymlinks')
-rw-r--r-- | Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CPackSymlinks/SrcSymlinksCheck.cmake | 21 | ||||
-rw-r--r-- | Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt | 7 | ||||
-rw-r--r-- | Tests/RunCMake/CPackSymlinks/testcpacksym.tar | bin | 10240 -> 20480 bytes |
4 files changed, 25 insertions, 4 deletions
diff --git a/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake b/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake index 439d95e..5a8b7a0 100644 --- a/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake @@ -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() diff --git a/Tests/RunCMake/CPackSymlinks/SrcSymlinksCheck.cmake b/Tests/RunCMake/CPackSymlinks/SrcSymlinksCheck.cmake new file mode 100644 index 0000000..0041c92 --- /dev/null +++ b/Tests/RunCMake/CPackSymlinks/SrcSymlinksCheck.cmake @@ -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() diff --git a/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt b/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt index 24ad124..8b1ae57 100644 --- a/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt +++ b/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt @@ -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 diff --git a/Tests/RunCMake/CPackSymlinks/testcpacksym.tar b/Tests/RunCMake/CPackSymlinks/testcpacksym.tar Binary files differindex a44c656..c24af48 100644 --- a/Tests/RunCMake/CPackSymlinks/testcpacksym.tar +++ b/Tests/RunCMake/CPackSymlinks/testcpacksym.tar |