diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2016-11-27 14:30:46 (GMT) |
---|---|---|
committer | Domen Vrankar <domen.vrankar@gmail.com> | 2016-11-27 22:20:35 (GMT) |
commit | b687d2ba093b1b79e9faf09e45d11567b0ec9ac1 (patch) | |
tree | e71ea1d488d0e1130fa2f211bdabff0a322fc86b /Tests/RunCMake | |
parent | ed8858edb7c5100e1928c5a94f85485f0e322aa7 (diff) | |
download | CMake-b687d2ba093b1b79e9faf09e45d11567b0ec9ac1.zip CMake-b687d2ba093b1b79e9faf09e45d11567b0ec9ac1.tar.gz CMake-b687d2ba093b1b79e9faf09e45d11567b0ec9ac1.tar.bz2 |
Tests: CPack test use same content list
Content list for a certain test
should be the same between different
generators so whenever possible use
a single expected files list per
file for all generators.
Diffstat (limited to 'Tests/RunCMake')
22 files changed, 154 insertions, 107 deletions
diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake index e5cda08..349b987 100644 --- a/Tests/RunCMake/CPack/DEB/Helpers.cmake +++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake @@ -29,6 +29,27 @@ function(getPackageNameGlobexpr NAME COMPONENT VERSION REVISION FILE_NO RESULT_V endif() endfunction() +function(getPackageContentList FILE RESULT_VAR) + execute_process(COMMAND ${DPKG_EXECUTABLE} -c "${FILE}" + OUTPUT_VARIABLE package_content_ + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + unset(items_) + string(REPLACE "\n" ";" package_content_ "${package_content_}") + foreach(i_ IN LISTS package_content_) + string(REGEX REPLACE "^.* \.(/[^$]*)$" "\\1" result_ "${i_}") + string(REGEX REPLACE "/$" "" result_ "${result_}") + list(APPEND items_ "${result_}") + endforeach() + + set(${RESULT_VAR} "${items_}" PARENT_SCOPE) +endfunction() + +function(toExpectedContentList FILE_NO CONTENT_VAR) + # no need to do anything +endfunction() + function(getMissingShlibsErrorExtra FILE RESULT_VAR) execute_process(COMMAND ${DPKG_EXECUTABLE} -x "${FILE}" data_${PREFIX} ERROR_VARIABLE err_) diff --git a/Tests/RunCMake/CPack/RPM/Helpers.cmake b/Tests/RunCMake/CPack/RPM/Helpers.cmake index 9ed03e2..bbc358c8 100644 --- a/Tests/RunCMake/CPack/RPM/Helpers.cmake +++ b/Tests/RunCMake/CPack/RPM/Helpers.cmake @@ -29,6 +29,39 @@ function(getPackageNameGlobexpr NAME COMPONENT VERSION REVISION FILE_NO RESULT_V endif() endfunction() +function(getPackageContentList FILE RESULT_VAR) + execute_process(COMMAND ${RPM_EXECUTABLE} -pql ${FILE} + OUTPUT_VARIABLE package_content_ + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REGEX REPLACE "\n" ";" package_content_ "${package_content_}") + + set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE) +endfunction() + +function(toExpectedContentList FILE_NO CONTENT_VAR) + if(NOT DEFINED TEST_INSTALL_PREFIX_PATHS) + set(TEST_INSTALL_PREFIX_PATHS "/usr") + endif() + + unset(filtered_) + foreach(part_ IN LISTS ${CONTENT_VAR}) + unset(dont_add_) + foreach(for_removal_ IN LISTS TEST_INSTALL_PREFIX_PATHS) + if(part_ STREQUAL for_removal_) + set(dont_add_ TRUE) + break() + endif() + endforeach() + + if(NOT dont_add_) + list(APPEND filtered_ "${part_}") + endif() + endforeach() + + set(${CONTENT_VAR} "${filtered_}" PARENT_SCOPE) +endfunction() + function(getPackageInfo FILE RESULT_VAR) execute_process(COMMAND ${RPM_EXECUTABLE} -pqi ${FILE} OUTPUT_VARIABLE info_content diff --git a/Tests/RunCMake/CPack/TGZ/Helpers.cmake b/Tests/RunCMake/CPack/TGZ/Helpers.cmake index 50fda9e..8715258 100644 --- a/Tests/RunCMake/CPack/TGZ/Helpers.cmake +++ b/Tests/RunCMake/CPack/TGZ/Helpers.cmake @@ -16,3 +16,41 @@ function(getPackageNameGlobexpr NAME COMPONENT VERSION REVISION FILE_NO RESULT_V set(${RESULT_VAR} "${NAME}-${VERSION}-*${COMPONENT}.tar.gz" PARENT_SCOPE) endfunction() + +function(getPackageContentList FILE RESULT_VAR) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar -ztf ${FILE} + OUTPUT_VARIABLE package_content_ + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + string(REPLACE "\n" ";" package_content_ "${package_content_}") + foreach(i_ IN LISTS package_content_) + string(REGEX REPLACE "/$" "" result_ "${i_}") + list(APPEND items_ "${result_}") + endforeach() + + set(${RESULT_VAR} "${items_}" PARENT_SCOPE) +endfunction() + +function(toExpectedContentList FILE_NO CONTENT_VAR) + findExpectedFile("${FILE_NO}" "file_") + + get_filename_component(prefix_ "${file_}" NAME) + # NAME_WE removes everything after the dot and dot is in version so use this instead + string(REPLACE ".tar.gz" "" prefix_ "${prefix_}") + + if(NOT DEFINED TEST_MAIN_INSTALL_PREFIX_PATH) + set(TEST_MAIN_INSTALL_PREFIX_PATH "/usr") + endif() + + unset(filtered_) + foreach(part_ IN LISTS ${CONTENT_VAR}) + string(REPLACE "${TEST_MAIN_INSTALL_PREFIX_PATH}" "" part_ "${part_}") + + if(part_) + list(APPEND filtered_ "${prefix_}${part_}") + endif() + endforeach() + + set(${CONTENT_VAR} "${filtered_}" PARENT_SCOPE) +endfunction() diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake index 835f654..59751a7 100644 --- a/Tests/RunCMake/CPack/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/VerifyResult.cmake @@ -45,10 +45,26 @@ if(NOT EXPECTED_FILES_COUNT EQUAL 0) if(foundFilesCount_ EQUAL 1) unset(PACKAGE_CONTENT) - getPackageContent("${bin_dir}/${FOUND_FILE_${file_no_}}" "PACKAGE_CONTENT") - string(REGEX MATCH "${EXPECTED_FILE_CONTENT_${file_no_}}" - expected_content_list "${PACKAGE_CONTENT}") + if(DEFINED EXPECTED_FILE_CONTENT_${file_no_}) + getPackageContent("${bin_dir}/${FOUND_FILE_${file_no_}}" "PACKAGE_CONTENT") + + string(REGEX MATCH "${EXPECTED_FILE_CONTENT_${file_no_}}" + expected_content_list "${PACKAGE_CONTENT}") + else() # use content list + getPackageContentList("${bin_dir}/${FOUND_FILE_${file_no_}}" "PACKAGE_CONTENT") + set(EXPECTED_FILE_CONTENT_${file_no_} "${EXPECTED_FILE_CONTENT_${file_no_}_LIST}") + toExpectedContentList("${file_no_}" "EXPECTED_FILE_CONTENT_${file_no_}") + + list(SORT PACKAGE_CONTENT) + list(SORT EXPECTED_FILE_CONTENT_${file_no_}) + + if(PACKAGE_CONTENT STREQUAL EXPECTED_FILE_CONTENT_${file_no_}) + set(expected_content_list TRUE) + else() + set(expected_content_list FALSE) + endif() + endif() if(NOT expected_content_list) string(REPLACE "\n" "\n actual> " msg_actual "\n${PACKAGE_CONTENT}") diff --git a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake index 700f72c..12970cb 100644 --- a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake @@ -1,13 +1,9 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "1") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) set(EXPECTED_FILE_1_COMPONENT "test") -if(GENERATOR_TYPE STREQUAL "DEB") - set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/empty/$") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(EXPECTED_FILE_CONTENT_1 "^/usr/empty$") -elseif(GENERATOR_TYPE STREQUAL "TGZ") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/empty") + +if(GENERATOR_TYPE STREQUAL "TGZ") set(EXPECTED_FILE_CONTENT_1 "^[^\n]*empty/$") endif() diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake index 01ae2d9..ae5f0af 100644 --- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake @@ -1,19 +1,10 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "3") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) set(EXPECTED_FILE_1_COMPONENT "pkg_1") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") set(EXPECTED_FILE_2_NAME "second") - -if(GENERATOR_TYPE STREQUAL "DEB") - set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_CONTENT_3 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_CONTENT_2 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_CONTENT_3 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") -endif() +set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") +set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") string(TOLOWER "${GENERATOR_TYPE}" file_extension_) diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake index 044744b..06e56d3 100644 --- a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake @@ -2,12 +2,13 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "5") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) + set(EXPECTED_FILE_1_COMPONENT "applications") -set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/test_prog$") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/test_prog") set(EXPECTED_FILE_2 "debuginfo*-headers.rpm") -set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") +set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/bar;/usr/bar/CMakeLists.txt") set(EXPECTED_FILE_3 "debuginfo*-libs.rpm") -set(EXPECTED_FILE_CONTENT_3 "^/usr/bas${whitespaces_}/usr/bas/libtest_lib.so$") +set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/bas;/usr/bas/libtest_lib.so") set(EXPECTED_FILE_4_COMPONENT "applications-debuginfo") set(EXPECTED_FILE_CONTENT_4 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*") diff --git a/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake index 97b7c0b..ded2923 100644 --- a/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake @@ -1,10 +1,8 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "3") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) set(EXPECTED_FILE_1_COMPONENT "foo") -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/foo/${whitespaces_}.*/usr/foo/CMakeLists.txt$") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") set(EXPECTED_FILE_2_COMPONENT "bar") -set(EXPECTED_FILE_CONTENT_2 "^.*/usr/${whitespaces_}.*/usr/bar/${whitespaces_}.*/usr/bar/CMakeLists.txt$") +set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/bar;/usr/bar/CMakeLists.txt") set(EXPECTED_FILE_3_COMPONENT "bas") -set(EXPECTED_FILE_CONTENT_3 "^.*/usr/${whitespaces_}.*/usr/bas/${whitespaces_}.*/usr/bas/CMakeLists.txt$") +set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/bas;/usr/bas/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/DEPENDENCIES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEPENDENCIES/ExpectedFiles.cmake index 7ab2961..3b280ba 100644 --- a/Tests/RunCMake/CPack/tests/DEPENDENCIES/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/DEPENDENCIES/ExpectedFiles.cmake @@ -1,23 +1,18 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "5") set(EXPECTED_FILE_1_COMPONENT "applications") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/test_prog") set(EXPECTED_FILE_2_COMPONENT "applications_auto") +set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/foo_auto;/usr/foo_auto/test_prog") set(EXPECTED_FILE_3_COMPONENT "headers") +set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/bar;/usr/bar/CMakeLists.txt") set(EXPECTED_FILE_4_COMPONENT "libs") +set(EXPECTED_FILE_CONTENT_4_LIST "/usr/bas;/usr/bas/libtest_lib.so") set(EXPECTED_FILE_5_COMPONENT "libs_auto") +set(EXPECTED_FILE_CONTENT_5_LIST "/usr;/usr/bas_auto;/usr/bas_auto/libtest_lib.so") if(GENERATOR_TYPE STREQUAL "DEB") - set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/test_prog$") - set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo_auto${whitespaces_}.*/usr/foo_auto/test_prog$") - set(EXPECTED_FILE_CONTENT_3 "^.*/usr/bar${whitespaces_}.*/usr/bar/CMakeLists.txt$") + set(whitespaces_ "[\t\n\r ]*") # dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it set(EXPECTED_FILE_CONTENT_4 "^.*/usr/bas${whitespaces_}.*/usr/bas/libtest_lib\\..*$") set(EXPECTED_FILE_CONTENT_5 "^.*/usr/bas_auto${whitespaces_}.*/usr/bas_auto/libtest_lib\\..*$") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/test_prog$") - set(EXPECTED_FILE_CONTENT_2 "^/usr/foo_auto${whitespaces_}/usr/foo_auto/test_prog$") - set(EXPECTED_FILE_CONTENT_3 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") - set(EXPECTED_FILE_CONTENT_4 "^/usr/bas${whitespaces_}/usr/bas/libtest_lib.so$") - set(EXPECTED_FILE_CONTENT_5 "^/usr/bas_auto${whitespaces_}/usr/bas_auto/libtest_lib.so$") endif() diff --git a/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake index bdeae28..858a496 100644 --- a/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake @@ -1,12 +1,3 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "1") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) - -if(GENERATOR_TYPE STREQUAL "DEB") - set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/empty/$") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(EXPECTED_FILE_CONTENT_1 "^/usr/empty$") -elseif(GENERATOR_TYPE STREQUAL "TGZ") - set(EXPECTED_FILE_CONTENT_1 "^[^\n]*empty_dir-0.1.1-[^\n]*/empty/$") -endif() +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/empty") diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake index 36a7014..44346ab 100644 --- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake @@ -1,7 +1,5 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "2") set(EXPECTED_FILE_1_COMPONENT "foo") -set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") set(EXPECTED_FILE_2_COMPONENT "bar") -set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") +set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/bar;/usr/bar/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake index 6733228..631d957 100644 --- a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake @@ -1,5 +1,3 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "1") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/foo/${whitespaces_}.*/usr/foo/llllllllll_oooooooooo_nnnnnnnnnn_gggggggggg_ffffffffff_iiiiiiiiii_llllllllll_eeeeeeeeee_nnnnnnnnnn_aaaaaaaaaa_mmmmmmmmmm_eeeeeeeeee.txt$") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/llllllllll_oooooooooo_nnnnnnnnnn_gggggggggg_ffffffffff_iiiiiiiiii_llllllllll_eeeeeeeeee_nnnnnnnnnn_aaaaaaaaaa_mmmmmmmmmm_eeeeeeeeee.txt") diff --git a/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake index 84a1510..6bfb0c1 100644 --- a/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake @@ -1,13 +1,11 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "0") if(NOT RunCMake_SUBTEST_SUFFIX STREQUAL "invalid") set(EXPECTED_FILES_COUNT "3") set(EXPECTED_FILE_1 "main_component-0.1.1-1.*.rpm") - set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") + set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") set(EXPECTED_FILE_2_COMPONENT "headers") - set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") + set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/bar;/usr/bar/CMakeLists.txt") set(EXPECTED_FILE_3_COMPONENT "libs") - set(EXPECTED_FILE_CONTENT_3 "^/usr/bas${whitespaces_}/usr/bas/CMakeLists.txt$") + set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/bas;/usr/bas/CMakeLists.txt") endif() diff --git a/Tests/RunCMake/CPack/tests/MINIMAL/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/MINIMAL/ExpectedFiles.cmake index b707464..6142eb3 100644 --- a/Tests/RunCMake/CPack/tests/MINIMAL/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/MINIMAL/ExpectedFiles.cmake @@ -1,11 +1,2 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "1") - -if(GENERATOR_TYPE STREQUAL "DEB") - set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/foo/${whitespaces_}.*/usr/foo/CMakeLists.txt$") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") -elseif(GENERATOR_TYPE STREQUAL "TGZ") - set(EXPECTED_FILE_CONTENT_1 "^[^\n]*minimal-0.1.1-[^\n]*/foo/\n[^\n]*minimal-0.1.1-[^\n]*/foo/CMakeLists.txt$") -endif() +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake index 6a300e9..eed5b92 100644 --- a/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake @@ -1,8 +1,6 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "0") -if (NOT ${RunCMake_SUBTEST_SUFFIX} MATCHES "invalid") +if(NOT ${RunCMake_SUBTEST_SUFFIX} MATCHES "invalid") set(EXPECTED_FILES_COUNT "1") - set(EXPECTED_FILE_CONTENT_1 "^[^\n]*package_checksum*-[^\n]*/foo/\n[^\n]*package_checksum-[^\n]*/foo/CMakeLists.txt$") + set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") endif() diff --git a/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/ExpectedFiles.cmake index 5c824d4..ae58c4b 100644 --- a/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/ExpectedFiles.cmake @@ -1,4 +1,2 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_CONTENT_1 "^/not_relocatable${whitespaces_}/not_relocatable/CMakeLists.txt${whitespaces_}/opt$") +set(EXPECTED_FILE_CONTENT_1_LIST "/not_relocatable;/not_relocatable/CMakeLists.txt;/opt") diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake index c2ed511..9bdb176 100644 --- a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake @@ -1,17 +1,8 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "3") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) set(EXPECTED_FILE_1_COMPONENT "pkg_1") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") set(EXPECTED_FILE_2_NAME "second") +set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") set(EXPECTED_FILE_3_COMPONENT "pkg_3") - -if(GENERATOR_TYPE STREQUAL "DEB") - set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_CONTENT_3 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_CONTENT_2 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_CONTENT_3 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") -endif() +set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake index f227e1f..6142eb3 100644 --- a/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake @@ -1,4 +1,2 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake index f227e1f..6142eb3 100644 --- a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake @@ -1,4 +1,2 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake index 9c0dea4..ca866ea 100644 --- a/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake @@ -1,30 +1,29 @@ set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "0") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) if(RunCMake_SUBTEST_SUFFIX STREQUAL "valid" OR RunCMake_SUBTEST_SUFFIX STREQUAL "no_debuginfo") set(EXPECTED_FILES_COUNT "4") set(EXPECTED_FILE_1 "single_debuginfo-0.1.1-1.*.rpm") - set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/test_prog$") + set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/test_prog") set(EXPECTED_FILE_2 "single_debuginfo*-headers.rpm") - set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") + set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/bar;/usr/bar/CMakeLists.txt") set(EXPECTED_FILE_3 "single_debuginfo*-libs.rpm") - set(EXPECTED_FILE_CONTENT_3 "^/usr/bas${whitespaces_}/usr/bas/libtest_lib.so$") + set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/bas;/usr/bas/libtest_lib.so") set(EXPECTED_FILE_4_COMPONENT "debuginfo") set(EXPECTED_FILE_CONTENT_4 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp${whitespaces_}/src/src_1/test_lib.cpp.*") elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "one_component" OR RunCMake_SUBTEST_SUFFIX STREQUAL "one_component_no_debuginfo") set(EXPECTED_FILES_COUNT "2") set(EXPECTED_FILE_1 "single_debuginfo-0*-applications.rpm") - set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/test_prog$") + set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/test_prog") set(EXPECTED_FILE_2 "single_debuginfo-applications-debuginfo*.rpm") set(EXPECTED_FILE_CONTENT_2 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*") elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "one_component_main" OR RunCMake_SUBTEST_SUFFIX STREQUAL "no_components") set(EXPECTED_FILES_COUNT "2") set(EXPECTED_FILE_1 "single_debuginfo-0*.rpm") - set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/test_prog$") + set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/test_prog") set(EXPECTED_FILE_2 "single_debuginfo-debuginfo*.rpm") set(EXPECTED_FILE_CONTENT_2 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*") diff --git a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake index 05ea102..0a3e426 100644 --- a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake @@ -1,4 +1,2 @@ -set(whitespaces_ "[\t\n\r ]*") - set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_CONTENT_1 "^source_package-0.1.1.tar.gz${whitespaces_}source_package.spec$") +set(EXPECTED_FILE_CONTENT_1_LIST "source_package-0.1.1.tar.gz;source_package.spec") diff --git a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake index a84e296..bc54d79 100644 --- a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake @@ -1,3 +1,5 @@ +set(whitespaces_ "[\t\n\r ]*") + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_rpm") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/BUILD") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/BUILDROOT") |