Ver Fonte

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 <[email protected]>
Acked-by: Raffi Enficiaud <[email protected]>
Merge-request: !3514
Brad King há 6 anos atrás
pai
commit
f374ffb14b

+ 2 - 6
Tests/CPackComponentsDEB/CMakeLists.txt

@@ -4,8 +4,8 @@
 # application (mylibapp). We create a binary installer (a CPack Generator)
 # application (mylibapp). We create a binary installer (a CPack Generator)
 # which supports CPack components.
 # 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
 # Use GNUInstallDirs in order to enforce lib64 if needed
 include(GNUInstallDirs)
 include(GNUInstallDirs)
@@ -44,10 +44,6 @@ set(CPACK_PACKAGE_NAME "MyLib")
 set(CPACK_PACKAGE_CONTACT "None")
 set(CPACK_PACKAGE_CONTACT "None")
 set(CPACK_PACKAGE_VENDOR "CMake.org")
 set(CPACK_PACKAGE_VENDOR "CMake.org")
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyLib - CPack Component Installation Example")
 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_PACKAGE_INSTALL_DIRECTORY "CPack Component Example")
 set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/license.txt)
 set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/license.txt)
 
 

+ 11 - 21
Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake

@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 
 
 
 # expected results
 # 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(expected_count 3)
 
 
 
 
@@ -36,7 +36,6 @@ endif()
 # dpkg-deb checks for the dependencies of the packages
 # dpkg-deb checks for the dependencies of the packages
 find_program(DPKGDEB_EXECUTABLE dpkg-deb)
 find_program(DPKGDEB_EXECUTABLE dpkg-deb)
 if(DPKGDEB_EXECUTABLE)
 if(DPKGDEB_EXECUTABLE)
-  set(dpkgdeb_output_errors_all "")
   foreach(_f IN LISTS actual_output)
   foreach(_f IN LISTS actual_output)
 
 
     # extracts the metadata from the package
     # extracts the metadata from the package
@@ -54,32 +53,23 @@ if(DPKGDEB_EXECUTABLE)
 
 
     message(STATUS "package='${dpkg_package_name}', dependencies='${dpkg_depends}'")
     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()
       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()
       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()
       endif()
     else()
     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()
     endif()
 
 
   endforeach()
   endforeach()
-
-
-  if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
-    message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
-  endif()
 else()
 else()
   message("dpkg-deb executable not found - skipping dpkg-deb test")
   message("dpkg-deb executable not found - skipping dpkg-deb test")
 endif()
 endif()

+ 12 - 24
Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake

@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 
 
 
 # expected results
 # 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(expected_count 3)
 
 
 set(config_verbose -V)
 set(config_verbose -V)
@@ -36,7 +36,6 @@ endif()
 # dpkg-deb checks for the summary of the packages
 # dpkg-deb checks for the summary of the packages
 find_program(DPKGDEB_EXECUTABLE dpkg-deb)
 find_program(DPKGDEB_EXECUTABLE dpkg-deb)
 if(DPKGDEB_EXECUTABLE)
 if(DPKGDEB_EXECUTABLE)
-  set(dpkgdeb_output_errors_all "")
   foreach(_f IN LISTS actual_output)
   foreach(_f IN LISTS actual_output)
 
 
     # extracts the metadata from the package
     # extracts the metadata from the package
@@ -54,13 +53,11 @@ if(DPKGDEB_EXECUTABLE)
 
 
     message(STATUS "package='${dpkg_package_name}', dependencies='${dpkg_depends}'")
     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)
       find_program(DPKG_SHLIBDEP_EXECUTABLE dpkg-shlibdeps)
       if(DPKG_SHLIBDEP_EXECUTABLE)
       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()
         endif()
       else()
       else()
         message("dpkg-shlibdeps executable not found - skipping dpkg-shlibdeps test")
         message("dpkg-shlibdeps executable not found - skipping dpkg-shlibdeps test")
@@ -69,29 +66,20 @@ if(DPKGDEB_EXECUTABLE)
       # should not contain the default
       # should not contain the default
       string(FIND "${dpkg_depends}" "depend-default" index_default)
       string(FIND "${dpkg_depends}" "depend-default" index_default)
       if(index_default GREATER "0")
       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()
       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()
       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()
       endif()
     else()
     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()
     endif()
-
   endforeach()
   endforeach()
-
-  if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
-    message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
-  endif()
 else()
 else()
   message("dpkg-deb executable not found - skipping dpkg-deb test")
   message("dpkg-deb executable not found - skipping dpkg-deb test")
 endif()
 endif()

+ 7 - 7
Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake

@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 
 
 
 # expected results
 # 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(expected_count 3)
 
 
 
 
@@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE)
 
 
     message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'")
     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")
       if(NOT "${dpkg_description}" STREQUAL "applications_description")
         set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
         set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
                                       "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description")
                                       "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description")
       endif()
       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}
         set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
                                       "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description")
                                       "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description")
       endif()
       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}
         set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
                                       "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != 'main description'")
                                       "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != 'main description'")
       endif()
       endif()
@@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE)
   endforeach()
   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}")
     message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
   endif()
   endif()
 else()
 else()

+ 8 - 8
Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake

@@ -7,7 +7,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 
 
 
 # expected results
 # 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(expected_count 3)
 
 
 
 
@@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE)
 
 
     message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'")
     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}
         set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
                                       "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description")
                                       "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description")
       endif()
       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}
         set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
                                       "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description")
                                       "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description")
       endif()
       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}
         set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
                                       "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != 'main description'")
                                       "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != 'main description'")
       endif()
       endif()
@@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE)
   endforeach()
   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}")
     message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
   endif()
   endif()
 else()
 else()

+ 4 - 4
Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake

@@ -5,7 +5,7 @@ endif()
 include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 
 # TODO: currently debian doesn't produce lower cased names
 # 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)
 set(expected_count 3)
 
 
 
 
@@ -44,7 +44,7 @@ if(LINTIAN_EXECUTABLE)
     string(APPEND lintian_output_errors_all "${lintian_output_errors}")
     string(APPEND lintian_output_errors_all "${lintian_output_errors}")
   endforeach()
   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}")
     message(FATAL_ERROR "Lintian checks failed:\n${lintian_output_errors_all}")
   endif()
   endif()
 else()
 else()
@@ -64,13 +64,13 @@ if(DPKGDEB_EXECUTABLE)
                                       DPKGDEB_OUTPUT "${dpkg_output}"
                                       DPKGDEB_OUTPUT "${dpkg_output}"
                                       METAENTRY "Maintainer:")
                                       METAENTRY "Maintainer:")
 
 
-    if(NOT "${dpkgentry}" STREQUAL "None")
+    if(NOT dpkgentry STREQUAL "None")
       set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
       set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
           "dpkg-deb: ${_f}: Incorrect value for Maintainer: ${dpkgentry} != None\n")
           "dpkg-deb: ${_f}: Incorrect value for Maintainer: ${dpkgentry} != None\n")
     endif()
     endif()
   endforeach()
   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}")
     message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
   endif()
   endif()
 else()
 else()

+ 6 - 6
Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake

@@ -9,7 +9,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 # requirements
 # requirements
 
 
 # debian now produces lower case names
 # 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)
 set(expected_count 3)
 
 
 
 
@@ -39,7 +39,7 @@ endif()
 # dpkg-deb checks for the summary of the packages
 # dpkg-deb checks for the summary of the packages
 find_program(DPKGDEB_EXECUTABLE dpkg-deb)
 find_program(DPKGDEB_EXECUTABLE dpkg-deb)
 if(DPKGDEB_EXECUTABLE)
 if(DPKGDEB_EXECUTABLE)
-  set(dpkgdeb_output_errors_all)
+  set(dpkgdeb_output_errors_all "")
   foreach(_f IN LISTS actual_output)
   foreach(_f IN LISTS actual_output)
 
 
     # extracts the metadata from the package
     # extracts the metadata from the package
@@ -53,11 +53,11 @@ if(DPKGDEB_EXECUTABLE)
 
 
     message(STATUS "package='${dpkg_package_name}'")
     message(STATUS "package='${dpkg_package_name}'")
 
 
-    if("${dpkg_package_name}" STREQUAL "mylib-applications")
+    if(dpkg_package_name STREQUAL "mylib-applications")
       # pass
       # pass
-    elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
+    elseif(dpkg_package_name STREQUAL "mylib-headers")
       # pass
       # pass
-    elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
+    elseif(dpkg_package_name STREQUAL "mylib-libraries")
       # pass
       # pass
     else()
     else()
       set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
       set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
@@ -67,7 +67,7 @@ if(DPKGDEB_EXECUTABLE)
   endforeach()
   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}")
     message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
   endif()
   endif()
 else()
 else()

+ 6 - 13
Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake

@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 
 
 
 # expected results
 # 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(expected_count 3)
 
 
 set(config_verbose -V)
 set(config_verbose -V)
@@ -36,7 +36,6 @@ endif()
 # dpkg-deb checks for the summary of the packages
 # dpkg-deb checks for the summary of the packages
 find_program(DPKGDEB_EXECUTABLE dpkg-deb)
 find_program(DPKGDEB_EXECUTABLE dpkg-deb)
 if(DPKGDEB_EXECUTABLE)
 if(DPKGDEB_EXECUTABLE)
-  set(dpkgdeb_output_errors_all "")
   foreach(_f IN LISTS actual_output)
   foreach(_f IN LISTS actual_output)
 
 
     # extracts the metadata from the package
     # extracts the metadata from the package
@@ -54,22 +53,16 @@ if(DPKGDEB_EXECUTABLE)
 
 
     message(STATUS "package='${_f}', source='${dpkg_package_source}'")
     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()
       endif()
     else()
     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()
     endif()
     endif()
   endforeach()
   endforeach()
-
-  if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
-    message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
-  endif()
 else()
 else()
   message("dpkg-deb executable not found - skipping dpkg-deb test")
   message("dpkg-deb executable not found - skipping dpkg-deb test")
 endif()
 endif()

+ 3 - 9
Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake

@@ -5,7 +5,7 @@ endif()
 include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
 
 
 # TODO: currently debian doesn't produce lower cased names
 # 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(expected_count 1)
 
 
 set(actual_output)
 set(actual_output)
@@ -33,22 +33,16 @@ endif()
 # dpkg-deb checks
 # dpkg-deb checks
 find_program(DPKGDEB_EXECUTABLE dpkg-deb)
 find_program(DPKGDEB_EXECUTABLE dpkg-deb)
 if(DPKGDEB_EXECUTABLE)
 if(DPKGDEB_EXECUTABLE)
-  set(dpkgdeb_output_errors_all "")
   foreach(_f IN LISTS actual_output)
   foreach(_f IN LISTS actual_output)
     run_dpkgdeb(dpkg_output
     run_dpkgdeb(dpkg_output
                 FILENAME "${_f}"
                 FILENAME "${_f}"
                 )
                 )
 
 
     # message(FATAL_ERROR "output = '${dpkg_output}'")
     # 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()
     endif()
   endforeach()
   endforeach()
-
-  if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
-    message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
-  endif()
 else()
 else()
   message("dpkg-deb executable not found - skipping dpkg-deb test")
   message("dpkg-deb executable not found - skipping dpkg-deb test")
 endif()
 endif()

+ 3 - 3
Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake

@@ -119,13 +119,13 @@ function(lintian_check_specific_errors output_errors)
   # regex to avoid
   # regex to avoid
   foreach(_s IN LISTS lintian_check_specific_errors_deb_ERROR_REGEX_STRINGS)
   foreach(_s IN LISTS lintian_check_specific_errors_deb_ERROR_REGEX_STRINGS)
 
 
-    if("${_s}" STREQUAL "")
+    if(_s STREQUAL "")
        continue()
        continue()
     endif()
     endif()
 
 
     string(REGEX MATCHALL "${_s}" "_TMP_CHECK_ERROR" "${lintian_output}")
     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}")
       string(APPEND ERROR_ACC "\nlintian: ${_f}: output contains an undesirable regex:\n\t${_TMP_CHECK_ERROR}")
     endif()
     endif()
   endforeach()
   endforeach()
@@ -167,7 +167,7 @@ function(run_dpkgdeb dpkg_deb_output)
       ERROR_VARIABLE DPKGDEB_ERROR
       ERROR_VARIABLE DPKGDEB_ERROR
       OUTPUT_STRIP_TRAILING_WHITESPACE )
       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}'")
       message(FATAL_ERROR "Error '${DPKGDEB_RESULT}' returned by dpkg-deb: '${DPKGDEB_ERROR}'")
     endif()
     endif()