summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-09 13:36:58 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-07-09 13:38:40 (GMT)
commitf374ffb14b3e55bbee8e7bb0eb3e5a33ee3612f1 (patch)
treed62cc23d3f9ea6f610edaf3933a85dd7a3654937
parent0575c81b5dab6abd8050d675e3180e0f78cc8741 (diff)
parent7929912b371f8fc7ec7637a9e834e784b4a4414c (diff)
downloadCMake-f374ffb14b3e55bbee8e7bb0eb3e5a33ee3612f1.zip
CMake-f374ffb14b3e55bbee8e7bb0eb3e5a33ee3612f1.tar.gz
CMake-f374ffb14b3e55bbee8e7bb0eb3e5a33ee3612f1.tar.bz2
Merge topic 'cpack-deb-test'
7929912b37 CPackComponentsDEB test: simplify error reporting 3d11c63c9c CPackComponentsDEB test: simplify if() arguments 09cf052079 CPackComponentsDEB test: simplify package version generation Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Raffi Enficiaud <raffi.enficiaud@free.fr> Merge-request: !3514
-rw-r--r--Tests/CPackComponentsDEB/CMakeLists.txt8
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake32
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake36
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake14
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake16
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake8
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake12
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake19
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake12
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake6
10 files changed, 62 insertions, 101 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..beccc46 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)
@@ -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
@@ -54,32 +53,23 @@ 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")
- set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n")
+ if(dpkg_package_name STREQUAL "mylib-applications")
+ if(NOT dpkg_depends STREQUAL "depend-application")
+ 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.2), 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")
+ elseif(dpkg_package_name STREQUAL "mylib-headers")
+ if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers")
+ 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")
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
+ if(NOT dpkg_depends STREQUAL "depend-default")
+ 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 81dbbc5..88f3248 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)
@@ -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
@@ -54,13 +53,11 @@ 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)
- 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.2), 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")
+ elseif(dpkg_package_name STREQUAL "mylib-headers")
+ if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers")
+ 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")
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
+ if(NOT dpkg_depends STREQUAL "depend-default")
+ 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-description1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
index ad52f56..f74137c 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)
@@ -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 af27c51..241dda5 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)
@@ -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 ec75d61..7cfbb16 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)
@@ -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 e57488c..6eff3db 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)
@@ -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 5ee057a..3454dca 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)
@@ -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
@@ -54,22 +53,16 @@ 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"))
- 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")
+ if(NOT dpkg_package_name STREQUAL "mylib-applications")
+ if(NOT dpkg_package_source STREQUAL "test-source")
+ 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")
+ if(NOT dpkg_package_source STREQUAL "test-other-source")
+ 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 8c0bc4b..764fe9d 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)
@@ -33,22 +33,16 @@ 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}"
)
# 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")
+ if(dpkg_output STREQUAL "")
+ 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()
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()