From 09cf0520794d3716c0931584f908a575cd8b59d0 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Fri, 5 Jul 2019 11:49:10 +0200 Subject: CPackComponentsDEB test: simplify package version generation --- Tests/CPackComponentsDEB/CMakeLists.txt | 8 ++------ .../RunCPackVerifyResult-components-depend1.cmake | 6 +++--- .../RunCPackVerifyResult-components-depend2.cmake | 6 +++--- .../RunCPackVerifyResult-components-description1.cmake | 2 +- .../RunCPackVerifyResult-components-description2.cmake | 2 +- .../RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake | 2 +- .../RunCPackVerifyResult-components-shlibdeps1.cmake | 2 +- .../RunCPackVerifyResult-components-source.cmake | 2 +- Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake | 2 +- 9 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt index 9d4b5e9..bc5b6a9 100644 --- a/Tests/CPackComponentsDEB/CMakeLists.txt +++ b/Tests/CPackComponentsDEB/CMakeLists.txt @@ -4,8 +4,8 @@ # application (mylibapp). We create a binary installer (a CPack Generator) # which supports CPack components. -cmake_minimum_required(VERSION 2.8.3.20101130 FATAL_ERROR) -project(CPackComponentsDEB) +cmake_minimum_required(VERSION 3.10 FATAL_ERROR) +project(CPackComponentsDEB VERSION 1.0.3) # Use GNUInstallDirs in order to enforce lib64 if needed include(GNUInstallDirs) @@ -44,10 +44,6 @@ set(CPACK_PACKAGE_NAME "MyLib") set(CPACK_PACKAGE_CONTACT "None") set(CPACK_PACKAGE_VENDOR "CMake.org") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyLib - CPack Component Installation Example") -set(CPACK_PACKAGE_VERSION "1.0.2") -set(CPACK_PACKAGE_VERSION_MAJOR "1") -set(CPACK_PACKAGE_VERSION_MINOR "0") -set(CPACK_PACKAGE_VERSION_PATCH "2") set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example") set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/license.txt) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake index 73fd0ab..dc25516 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake @@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # expected results -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) @@ -60,9 +60,9 @@ if(DPKGDEB_EXECUTABLE) "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n") endif() elseif("${dpkg_package_name}" STREQUAL "mylib-headers") - if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.2), depend-headers") + if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.3), depend-headers") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.2), depend-headers'\n") + "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") endif() elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") if(NOT "${dpkg_depends}" STREQUAL "depend-default") diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake index 81dbbc5..1f2f408 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake @@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # expected results -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) set(config_verbose -V) @@ -73,9 +73,9 @@ if(DPKGDEB_EXECUTABLE) "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n") endif() elseif("${dpkg_package_name}" STREQUAL "mylib-headers") - if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.2), depend-headers") + if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.3), depend-headers") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.2), depend-headers'\n") + "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") endif() elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") if(NOT "${dpkg_depends}" STREQUAL "depend-default") diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake index ad52f56..ba94127 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake @@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # expected results -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake index af27c51..1cc5a18 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake @@ -7,7 +7,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # expected results -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake index ec75d61..9f927ee 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake @@ -5,7 +5,7 @@ endif() include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # TODO: currently debian doesn't produce lower cased names -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake index e57488c..03d003e 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake @@ -9,7 +9,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # requirements # debian now produces lower case names -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake index 5ee057a..47956c6 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake @@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # expected results -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) set(config_verbose -V) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake index 8c0bc4b..d2fbc91 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake @@ -5,7 +5,7 @@ endif() include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # TODO: currently debian doesn't produce lower cased names -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib_1.0.3_*.deb") set(expected_count 1) set(actual_output) -- cgit v0.12 From 3d11c63c9c338c4ed6e5d171f86af9cf6a7fca0f Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Fri, 5 Jul 2019 11:50:38 +0200 Subject: CPackComponentsDEB test: simplify if() arguments --- .../RunCPackVerifyResult-components-depend1.cmake | 14 +++++++------- .../RunCPackVerifyResult-components-depend2.cmake | 12 ++++++------ .../RunCPackVerifyResult-components-description1.cmake | 12 ++++++------ .../RunCPackVerifyResult-components-description2.cmake | 14 +++++++------- ...ackVerifyResult-components-lintian-dpkgdeb-checks.cmake | 6 +++--- .../RunCPackVerifyResult-components-shlibdeps1.cmake | 10 +++++----- .../RunCPackVerifyResult-components-source.cmake | 8 ++++---- .../RunCPackVerifyResult-compression.cmake | 4 ++-- Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake | 6 +++--- 9 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake index dc25516..fa8b5a4 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake @@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE) message(STATUS "package='${dpkg_package_name}', dependencies='${dpkg_depends}'") - if("${dpkg_package_name}" STREQUAL "mylib-applications") - if(NOT "${dpkg_depends}" STREQUAL "depend-application") + if(dpkg_package_name STREQUAL "mylib-applications") + if(NOT dpkg_depends STREQUAL "depend-application") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-headers") - if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.3), depend-headers") + elseif(dpkg_package_name STREQUAL "mylib-headers") + if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") - if(NOT "${dpkg_depends}" STREQUAL "depend-default") + elseif(dpkg_package_name STREQUAL "mylib-libraries") + if(NOT dpkg_depends STREQUAL "depend-default") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n") endif() @@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE) endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake index 1f2f408..1d45b78 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake @@ -54,7 +54,7 @@ if(DPKGDEB_EXECUTABLE) message(STATUS "package='${dpkg_package_name}', dependencies='${dpkg_depends}'") - if("${dpkg_package_name}" STREQUAL "mylib-applications") + if(dpkg_package_name STREQUAL "mylib-applications") find_program(DPKG_SHLIBDEP_EXECUTABLE dpkg-shlibdeps) if(DPKG_SHLIBDEP_EXECUTABLE) string(FIND "${dpkg_depends}" "lib" index_libwhatever) @@ -72,13 +72,13 @@ if(DPKGDEB_EXECUTABLE) set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-headers") - if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.3), depend-headers") + elseif(dpkg_package_name STREQUAL "mylib-headers") + if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") - if(NOT "${dpkg_depends}" STREQUAL "depend-default") + elseif(dpkg_package_name STREQUAL "mylib-libraries") + if(NOT dpkg_depends STREQUAL "depend-default") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n") endif() @@ -89,7 +89,7 @@ if(DPKGDEB_EXECUTABLE) endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake index ba94127..f74137c 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake @@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE) message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'") - if("${dpkg_package_name}" STREQUAL "mylib-applications") + if(dpkg_package_name STREQUAL "mylib-applications") if(NOT "${dpkg_description}" STREQUAL "applications_description") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-headers") - if(NOT "${dpkg_description}" STREQUAL "headers_description") + elseif(dpkg_package_name STREQUAL "mylib-headers") + if(NOT dpkg_description STREQUAL "headers_description") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") - if(NOT "${dpkg_description}" STREQUAL "main description") + elseif(dpkg_package_name STREQUAL "mylib-libraries") + if(NOT dpkg_description STREQUAL "main description") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != 'main description'") endif() @@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE) endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake index 1cc5a18..241dda5 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake @@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE) message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'") - if("${dpkg_package_name}" STREQUAL "mylib-applications") - if(NOT "${dpkg_description}" STREQUAL "main description 2") + if(dpkg_package_name STREQUAL "mylib-applications") + if(NOT dpkg_description STREQUAL "main description 2") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-headers") - if(NOT "${dpkg_description}" STREQUAL "main description 2") + elseif(dpkg_package_name STREQUAL "mylib-headers") + if(NOT dpkg_description STREQUAL "main description 2") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") - if(NOT "${dpkg_description}" STREQUAL "library description") + elseif(dpkg_package_name STREQUAL "mylib-libraries") + if(NOT dpkg_description STREQUAL "library description") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != 'main description'") endif() @@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE) endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake index 9f927ee..7cfbb16 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake @@ -44,7 +44,7 @@ if(LINTIAN_EXECUTABLE) string(APPEND lintian_output_errors_all "${lintian_output_errors}") endforeach() - if(NOT "${lintian_output_errors_all}" STREQUAL "") + if(NOT lintian_output_errors_all STREQUAL "") message(FATAL_ERROR "Lintian checks failed:\n${lintian_output_errors_all}") endif() else() @@ -64,13 +64,13 @@ if(DPKGDEB_EXECUTABLE) DPKGDEB_OUTPUT "${dpkg_output}" METAENTRY "Maintainer:") - if(NOT "${dpkgentry}" STREQUAL "None") + if(NOT dpkgentry STREQUAL "None") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: Incorrect value for Maintainer: ${dpkgentry} != None\n") endif() endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake index 03d003e..6eff3db 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake @@ -39,7 +39,7 @@ endif() # dpkg-deb checks for the summary of the packages find_program(DPKGDEB_EXECUTABLE dpkg-deb) if(DPKGDEB_EXECUTABLE) - set(dpkgdeb_output_errors_all) + set(dpkgdeb_output_errors_all "") foreach(_f IN LISTS actual_output) # extracts the metadata from the package @@ -53,11 +53,11 @@ if(DPKGDEB_EXECUTABLE) message(STATUS "package='${dpkg_package_name}'") - if("${dpkg_package_name}" STREQUAL "mylib-applications") + if(dpkg_package_name STREQUAL "mylib-applications") # pass - elseif("${dpkg_package_name}" STREQUAL "mylib-headers") + elseif(dpkg_package_name STREQUAL "mylib-headers") # pass - elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") + elseif(dpkg_package_name STREQUAL "mylib-libraries") # pass else() set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} @@ -67,7 +67,7 @@ if(DPKGDEB_EXECUTABLE) endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake index 47956c6..3830ca5 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake @@ -54,20 +54,20 @@ if(DPKGDEB_EXECUTABLE) message(STATUS "package='${_f}', source='${dpkg_package_source}'") - if(NOT ("${dpkg_package_name}" STREQUAL "mylib-applications")) - if(NOT ("${dpkg_package_source}" STREQUAL "test-source")) + if(NOT dpkg_package_name STREQUAL "mylib-applications") + if(NOT dpkg_package_source STREQUAL "test-source") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-source'\n") endif() else() - if(NOT ("${dpkg_package_source}" STREQUAL "test-other-source")) + if(NOT dpkg_package_source STREQUAL "test-other-source") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-other-source'\n") endif() endif() endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake index d2fbc91..06d24c4 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake @@ -40,13 +40,13 @@ if(DPKGDEB_EXECUTABLE) ) # message(FATAL_ERROR "output = '${dpkg_output}'") - if("${dpkg_output}" STREQUAL "") + if(dpkg_output STREQUAL "") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: empty content returned by dpkg-deb") endif() endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake index 2f9e2fc..2093e7e 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake @@ -119,13 +119,13 @@ function(lintian_check_specific_errors output_errors) # regex to avoid foreach(_s IN LISTS lintian_check_specific_errors_deb_ERROR_REGEX_STRINGS) - if("${_s}" STREQUAL "") + if(_s STREQUAL "") continue() endif() string(REGEX MATCHALL "${_s}" "_TMP_CHECK_ERROR" "${lintian_output}") - if(NOT "${_TMP_CHECK_ERROR}" STREQUAL "") + if(NOT _TMP_CHECK_ERROR STREQUAL "") string(APPEND ERROR_ACC "\nlintian: ${_f}: output contains an undesirable regex:\n\t${_TMP_CHECK_ERROR}") endif() endforeach() @@ -167,7 +167,7 @@ function(run_dpkgdeb dpkg_deb_output) ERROR_VARIABLE DPKGDEB_ERROR OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(NOT ("${DPKGDEB_RESULT}" EQUAL "0")) + if(NOT DPKGDEB_RESULT EQUAL "0") message(FATAL_ERROR "Error '${DPKGDEB_RESULT}' returned by dpkg-deb: '${DPKGDEB_ERROR}'") endif() -- cgit v0.12 From 7929912b371f8fc7ec7637a9e834e784b4a4414c Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Fri, 5 Jul 2019 12:16:48 +0200 Subject: CPackComponentsDEB test: simplify error reporting --- .../RunCPackVerifyResult-components-depend1.cmake | 18 ++++------------ .../RunCPackVerifyResult-components-depend2.cmake | 24 ++++++---------------- .../RunCPackVerifyResult-components-source.cmake | 11 ++-------- .../RunCPackVerifyResult-compression.cmake | 8 +------- 4 files changed, 13 insertions(+), 48 deletions(-) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake index fa8b5a4..beccc46 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake @@ -36,7 +36,6 @@ endif() # dpkg-deb checks for the dependencies of the packages find_program(DPKGDEB_EXECUTABLE dpkg-deb) if(DPKGDEB_EXECUTABLE) - set(dpkgdeb_output_errors_all "") foreach(_f IN LISTS actual_output) # extracts the metadata from the package @@ -56,30 +55,21 @@ if(DPKGDEB_EXECUTABLE) if(dpkg_package_name STREQUAL "mylib-applications") if(NOT dpkg_depends STREQUAL "depend-application") - set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n") endif() elseif(dpkg_package_name STREQUAL "mylib-headers") if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers") - set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") endif() elseif(dpkg_package_name STREQUAL "mylib-libraries") if(NOT dpkg_depends STREQUAL "depend-default") - set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n") endif() else() - set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} - "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n") + message(SEND_ERROR "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n") endif() endforeach() - - - if(NOT dpkgdeb_output_errors_all STREQUAL "") - message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") - endif() else() message("dpkg-deb executable not found - skipping dpkg-deb test") endif() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake index 1d45b78..88f3248 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake @@ -36,7 +36,6 @@ endif() # dpkg-deb checks for the summary of the packages find_program(DPKGDEB_EXECUTABLE dpkg-deb) if(DPKGDEB_EXECUTABLE) - set(dpkgdeb_output_errors_all "") foreach(_f IN LISTS actual_output) # extracts the metadata from the package @@ -57,10 +56,8 @@ if(DPKGDEB_EXECUTABLE) if(dpkg_package_name STREQUAL "mylib-applications") find_program(DPKG_SHLIBDEP_EXECUTABLE dpkg-shlibdeps) if(DPKG_SHLIBDEP_EXECUTABLE) - string(FIND "${dpkg_depends}" "lib" index_libwhatever) - if(NOT index_libwhatever GREATER "-1") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does not contain any 'lib'\n") + if(NOT dpkg_depends MATCHES "lib") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does not contain any 'lib'\n") endif() else() message("dpkg-shlibdeps executable not found - skipping dpkg-shlibdeps test") @@ -69,29 +66,20 @@ if(DPKGDEB_EXECUTABLE) # should not contain the default string(FIND "${dpkg_depends}" "depend-default" index_default) if(index_default GREATER "0") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n") endif() elseif(dpkg_package_name STREQUAL "mylib-headers") if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") endif() elseif(dpkg_package_name STREQUAL "mylib-libraries") if(NOT dpkg_depends STREQUAL "depend-default") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n") endif() else() - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n") + message(SEND_ERROR "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n") endif() - endforeach() - - if(NOT dpkgdeb_output_errors_all STREQUAL "") - message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") - endif() else() message("dpkg-deb executable not found - skipping dpkg-deb test") endif() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake index 3830ca5..3454dca 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake @@ -36,7 +36,6 @@ endif() # dpkg-deb checks for the summary of the packages find_program(DPKGDEB_EXECUTABLE dpkg-deb) if(DPKGDEB_EXECUTABLE) - set(dpkgdeb_output_errors_all "") foreach(_f IN LISTS actual_output) # extracts the metadata from the package @@ -56,20 +55,14 @@ if(DPKGDEB_EXECUTABLE) if(NOT dpkg_package_name STREQUAL "mylib-applications") if(NOT dpkg_package_source STREQUAL "test-source") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-source'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-source'\n") endif() else() if(NOT dpkg_package_source STREQUAL "test-other-source") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-other-source'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-other-source'\n") endif() endif() endforeach() - - if(NOT dpkgdeb_output_errors_all STREQUAL "") - message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") - endif() else() message("dpkg-deb executable not found - skipping dpkg-deb test") endif() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake index 06d24c4..764fe9d 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake @@ -33,7 +33,6 @@ endif() # dpkg-deb checks find_program(DPKGDEB_EXECUTABLE dpkg-deb) if(DPKGDEB_EXECUTABLE) - set(dpkgdeb_output_errors_all "") foreach(_f IN LISTS actual_output) run_dpkgdeb(dpkg_output FILENAME "${_f}" @@ -41,14 +40,9 @@ if(DPKGDEB_EXECUTABLE) # message(FATAL_ERROR "output = '${dpkg_output}'") if(dpkg_output STREQUAL "") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: empty content returned by dpkg-deb") + message(SEND_ERROR "dpkg-deb: ${_f}: empty content returned by dpkg-deb") endif() endforeach() - - if(NOT dpkgdeb_output_errors_all STREQUAL "") - message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") - endif() else() message("dpkg-deb executable not found - skipping dpkg-deb test") endif() -- cgit v0.12