diff options
author | Brad King <brad.king@kitware.com> | 2021-04-01 14:25:07 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-04-01 14:25:28 (GMT) |
commit | ac79fd8a0e53adae72331dffcea3b525ba3013a5 (patch) | |
tree | f35a2f6cc972a50a0091de162060cf2921097437 /Tests/RunCMake/CPack | |
parent | c5bd2e3b6d33568aa3574c8b1f7ec3dc41ff289f (diff) | |
parent | 31c184ad690be45494cf997df71ad09293a0d4b0 (diff) | |
download | CMake-ac79fd8a0e53adae72331dffcea3b525ba3013a5.zip CMake-ac79fd8a0e53adae72331dffcea3b525ba3013a5.tar.gz CMake-ac79fd8a0e53adae72331dffcea3b525ba3013a5.tar.bz2 |
Merge topic 'cpackrpm-debuginfo-single-package-install-erase-scripts'
31c184ad69 CPackRPM: handle scripts in debuginfo single package mode
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5953
Diffstat (limited to 'Tests/RunCMake/CPack')
6 files changed, 32 insertions, 2 deletions
diff --git a/Tests/RunCMake/CPack/RPM/Prerequirements.cmake b/Tests/RunCMake/CPack/RPM/Prerequirements.cmake index 3416205..e95cd15 100644 --- a/Tests/RunCMake/CPack/RPM/Prerequirements.cmake +++ b/Tests/RunCMake/CPack/RPM/Prerequirements.cmake @@ -13,4 +13,11 @@ function(get_test_prerequirements found_var config_file) "\nset(RPMBUILD_EXECUTABLE \"${RPMBUILD_EXECUTABLE}\")") set(${found_var} true PARENT_SCOPE) endif() + + # optional tool for some tests + find_program(OBJDUMP_EXECUTABLE objdump) + if(OBJDUMP_EXECUTABLE) + file(APPEND "${config_file}" + "\nset(OBJDUMP_EXECUTABLE \"${OBJDUMP_EXECUTABLE}\")") + endif() endfunction() diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 15bfb60..48b9c1d 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -16,7 +16,7 @@ run_cpack_test(VERSION "RPM.VERSION;DEB.VERSION" false "MONOLITHIC;COMPONENT") run_cpack_test(EXTRA "DEB.EXTRA" false "COMPONENT") run_cpack_test_subtests(GENERATE_SHLIBS "soversion_not_zero;soversion_zero" "DEB.GENERATE_SHLIBS" true "COMPONENT") run_cpack_test(GENERATE_SHLIBS_LDCONFIG "DEB.GENERATE_SHLIBS_LDCONFIG" true "COMPONENT") -run_cpack_test(INSTALL_SCRIPTS "RPM.INSTALL_SCRIPTS" false "COMPONENT") +run_cpack_test_subtests(INSTALL_SCRIPTS "default;single_debug_info" "RPM.INSTALL_SCRIPTS" false "COMPONENT") run_cpack_test(LONG_FILENAMES "DEB.LONG_FILENAMES" false "MONOLITHIC") run_cpack_test_subtests(MAIN_COMPONENT "invalid;found" "RPM.MAIN_COMPONENT" false "COMPONENT") run_cpack_test(MINIMAL "RPM.MINIMAL;DEB.MINIMAL;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External" false "MONOLITHIC;COMPONENT") diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake index de38df9..29e36a3 100644 --- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake @@ -1,5 +1,10 @@ +if(RunCMake_SUBTEST_SUFFIX STREQUAL "single_debug_info") + set(EXPECTED_FILE_1 "install_scripts-0.1.1-1.*.rpm") +else() + set(EXPECTED_FILE_1_COMPONENT "foo") +endif() + set(EXPECTED_FILES_COUNT "2") -set(EXPECTED_FILE_1_COMPONENT "foo") set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt") set(EXPECTED_FILE_2_COMPONENT "bar") set(EXPECTED_FILE_CONTENT_2_LIST "/bar;/bar/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/RPM-COMPONENT-single_debug_info-stderr.txt b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/RPM-COMPONENT-single_debug_info-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/RPM-COMPONENT-single_debug_info-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/RPM-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/RPM-Prerequirements.cmake new file mode 100644 index 0000000..c5d20cc --- /dev/null +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/RPM-Prerequirements.cmake @@ -0,0 +1,11 @@ +function(get_test_prerequirements found_var config_file) + if(SUBTEST_SUFFIX STREQUAL "single_debug_info") + include(${config_file}) + + if(OBJDUMP_EXECUTABLE) + set(${found_var} true PARENT_SCOPE) + endif() + else() + set(${found_var} true PARENT_SCOPE) + endif() +endfunction() diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake index c200fa5..6877c57 100644 --- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake @@ -24,6 +24,12 @@ if(GENERATOR_TYPE STREQUAL "RPM") "${CMAKE_CURRENT_BINARY_DIR}/pre_trans_foo.sh") set(CPACK_RPM_foo_POST_TRANS_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/post_trans_foo.sh") + + if(RunCMake_SUBTEST_SUFFIX STREQUAL "single_debug_info") + set(CPACK_RPM_MAIN_COMPONENT "foo") + set(CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE ON) + set(CPACK_RPM_FOO_FILE_NAME "RPM-DEFAULT") + endif() endif() set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) |