diff options
author | David Faure <faure@kde.org> | 2018-08-30 17:52:19 (GMT) |
---|---|---|
committer | David Faure <faure@kde.org> | 2018-08-30 20:08:11 (GMT) |
commit | 7a7e94d6f7b74eeb165cab39f3aeeaba690160ef (patch) | |
tree | 8a4ecd63ff0edf65c5134bdc515d9a09bafc8d78 /Tests | |
parent | 5563d6b3a64f6c9a83c1ab928e2283c84cb4af41 (diff) | |
download | CMake-7a7e94d6f7b74eeb165cab39f3aeeaba690160ef.zip CMake-7a7e94d6f7b74eeb165cab39f3aeeaba690160ef.tar.gz CMake-7a7e94d6f7b74eeb165cab39f3aeeaba690160ef.tar.bz2 |
CPack (DEB/RPM): add test for per-component description/summmary.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake | 14 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake | 7 |
2 files changed, 20 insertions, 1 deletions
diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake index 18ef63c..b4bdb61 100644 --- a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake @@ -1,7 +1,7 @@ function(checkPackageInfo_ TYPE FILE REGEX) getPackageInfo("${FILE}" "FILE_INFO_") if(NOT FILE_INFO_ MATCHES "${REGEX}") - message(FATAL_ERROR "Unexpected ${TYPE} in '${FILE}'; file info: '${FILE_INFO_}'") + message(FATAL_ERROR "Unexpected ${TYPE} in '${FILE}'; file info: '${FILE_INFO_}'; does not match '${REGEX}'") endif() endfunction() @@ -24,3 +24,15 @@ checkPackageInfo_("name" "${FOUND_FILE_3}" ".*${name_}${whitespaces_}:${whitespa checkPackageInfo_("group" "${FOUND_FILE_1}" ".*${group_}${whitespaces_}:${whitespaces_}default") checkPackageInfo_("group" "${FOUND_FILE_2}" ".*${group_}${whitespaces_}:${whitespaces_}second_group") checkPackageInfo_("group" "${FOUND_FILE_3}" ".*${group_}${whitespaces_}:${whitespaces_}default") + +# check package summaries (not available in DEB) +if(GENERATOR_TYPE STREQUAL "RPM") + checkPackageInfo_("summary" "${FOUND_FILE_1}" ".*Summary${whitespaces_}:${whitespaces_}Global summary") + checkPackageInfo_("summary" "${FOUND_FILE_2}" ".*Summary${whitespaces_}:${whitespaces_}Summary for pkg_2") + checkPackageInfo_("summary" "${FOUND_FILE_3}" ".*Summary${whitespaces_}:${whitespaces_}Global summary") +endif() + +# check package description +checkPackageInfo_("description" "${FOUND_FILE_1}" ".*Description${whitespaces_}:${whitespaces_}Description for pkg_1") +checkPackageInfo_("description" "${FOUND_FILE_2}" ".*Description${whitespaces_}:${whitespaces_}Description for pkg_2") +checkPackageInfo_("description" "${FOUND_FILE_3}" ".*Description${whitespaces_}:${whitespaces_}Description for pkg_3") diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake index 8719c0b..dc61d0a 100644 --- a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake +++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake @@ -11,6 +11,13 @@ if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PACKAGE_${group_} "default") set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_NAME "second") set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_${group_} "second_group") + + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PACKAGE_SUMMARY "Global summary") # not used for DEB + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_SUMMARY "Summary for pkg_2") # not used for DEB + + set(CPACK_COMPONENT_PKG_1_DESCRIPTION "Description for pkg_1") + set(CPACK_COMPONENT_PKG_2_DESCRIPTION "Description for pkg_2") + set(CPACK_COMPONENT_PKG_3_DESCRIPTION "Description for pkg_3") endif() install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) |