From a15f51620ba0142e05cfa6aebd346a5cf76ca302 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 6 Nov 2016 13:59:27 +0100 Subject: Tests: CPack fix for invalid config file path Invalid config file path was passed to per test specific prerequirements script. --- Tests/RunCMake/CPack/CPackTestHelpers.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake index 7e6b4b1..7cf44ed 100644 --- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake +++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake @@ -19,8 +19,7 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source) include("${RunCMake_SOURCE_DIR}/${TEST_TYPE}/${TEST_NAME}-Prerequirements.cmake") set(FOUND_PREREQUIREMENTS false) - get_test_prerequirements("FOUND_PREREQUIREMENTS" - "${TEST_CONFIG_DIR}/${type}_config.cmake") + get_test_prerequirements("FOUND_PREREQUIREMENTS" "${config_file}") # skip the test if prerequirements are not met if(NOT FOUND_PREREQUIREMENTS) -- cgit v0.12 From 70a2bfe97c1b024bff5fa6b6537528457ca5a7f4 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Fri, 11 Nov 2016 00:26:19 +0100 Subject: Tests: fix CPack test source packages missing generator type Source packages testing for RunCMake CPack tests did not provide generator type to the project built from source package. --- Tests/RunCMake/CPack/CPackTestHelpers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake index 7cf44ed..672fff0 100644 --- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake +++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake @@ -42,7 +42,7 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source) if(source) set(pack_params_ -G ${TEST_TYPE} --config ./CPackSourceConfig.cmake) FILE(APPEND ${RunCMake_TEST_BINARY_DIR}/CPackSourceConfig.cmake - "\nset(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS \"-DRunCMake_TEST:STRING=${full_test_name_}\ -DRunCMake_TEST_FILE_PREFIX:STRING=${TEST_NAME}\")") + "\nset(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS \"-DRunCMake_TEST:STRING=${full_test_name_}\ -DRunCMake_TEST_FILE_PREFIX:STRING=${TEST_NAME} -DGENERATOR_TYPE=${TEST_TYPE}\")") else() unset(pack_params_) endif() -- cgit v0.12 From 7763bd72076357b986daa7e21e4bfe163f58c84a Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sat, 26 Nov 2016 10:32:05 +0100 Subject: Tests: CPack/RPM test introduction of default stderr test output --- Tests/RunCMake/CPack/CPackTestHelpers.cmake | 2 ++ Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt | 1 - Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt | 3 --- Tests/RunCMake/CPack/RPM/DEBUGINFO-stderr.txt | 3 --- Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt | 1 - Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-found-stderr.txt | 3 --- Tests/RunCMake/CPack/RPM/MINIMAL-stderr.txt | 1 - Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_components-stderr.txt | 1 - Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_debuginfo-stderr.txt | 3 --- Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component-stderr.txt | 1 - .../RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component_main-stderr.txt | 1 - .../CPack/RPM/SINGLE_DEBUGINFO-one_component_no_debuginfo-stderr.txt | 1 - Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-valid-stderr.txt | 3 --- Tests/RunCMake/CPack/RPM/default_expected_stderr.txt | 1 + 14 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/DEBUGINFO-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-found-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/MINIMAL-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_components-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_debuginfo-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component_main-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component_no_debuginfo-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-valid-stderr.txt create mode 100644 Tests/RunCMake/CPack/RPM/default_expected_stderr.txt diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake index 672fff0..cf8ae23 100644 --- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake +++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake @@ -61,6 +61,8 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source) set(RunCMake-std${o}-file "${TEST_TYPE}/${TEST_NAME}-${SUBTEST_SUFFIX}-std${o}.txt") elseif(EXISTS ${RunCMake_SOURCE_DIR}/${TEST_TYPE}/${TEST_NAME}-std${o}.txt) set(RunCMake-std${o}-file "${TEST_TYPE}/${TEST_NAME}-std${o}.txt") + elseif(EXISTS ${RunCMake_SOURCE_DIR}/${TEST_TYPE}/default_expected_std${o}.txt) + set(RunCMake-std${o}-file "${TEST_TYPE}/default_expected_std${o}.txt") endif() endforeach() diff --git a/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt b/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt deleted file mode 100644 index 6ddca12..0000000 --- a/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/COMPONENTS_EMPTY_DIR-build/_CPack_Packages/.*/RPM/SPECS/components_empty_dir.spec$ diff --git a/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt deleted file mode 100644 index 9bfba7e..0000000 --- a/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt +++ /dev/null @@ -1,3 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_1.spec -CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/second.spec -CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_3.spec$ diff --git a/Tests/RunCMake/CPack/RPM/DEBUGINFO-stderr.txt b/Tests/RunCMake/CPack/RPM/DEBUGINFO-stderr.txt deleted file mode 100644 index 557ef3d..0000000 --- a/Tests/RunCMake/CPack/RPM/DEBUGINFO-stderr.txt +++ /dev/null @@ -1,3 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/DEBUGINFO-build/_CPack_Packages/.*/RPM/SPECS/debuginfo-applications.spec -CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/DEBUGINFO-build/_CPack_Packages/.*/RPM/SPECS/debuginfo-headers.spec -CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/DEBUGINFO-build/_CPack_Packages/.*/RPM/SPECS/debuginfo-libs.spec$ diff --git a/Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt b/Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt deleted file mode 100644 index 1777aa0..0000000 --- a/Tests/RunCMake/CPack/RPM/EMPTY_DIR-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/EMPTY_DIR-build/_CPack_Packages/.*/RPM/SPECS/empty_dir.spec$ diff --git a/Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-found-stderr.txt b/Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-found-stderr.txt deleted file mode 100644 index dff163d..0000000 --- a/Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-found-stderr.txt +++ /dev/null @@ -1,3 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/MAIN_COMPONENT-build-found-subtest/_CPack_Packages/.*/RPM/SPECS/main_component-headers.spec -CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/MAIN_COMPONENT-build-found-subtest/_CPack_Packages/.*/RPM/SPECS/main_component-libs.spec -CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/MAIN_COMPONENT-build-found-subtest/_CPack_Packages/.*/RPM/SPECS/main_component.spec$ diff --git a/Tests/RunCMake/CPack/RPM/MINIMAL-stderr.txt b/Tests/RunCMake/CPack/RPM/MINIMAL-stderr.txt deleted file mode 100644 index 7c5fb46..0000000 --- a/Tests/RunCMake/CPack/RPM/MINIMAL-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/MINIMAL-build/_CPack_Packages/.*/RPM/SPECS/minimal.spec$ diff --git a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_components-stderr.txt b/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_components-stderr.txt deleted file mode 100644 index d80939f..0000000 --- a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_components-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/SINGLE_DEBUGINFO-build-no_components-subtest/_CPack_Packages/.*/RPM/SPECS/single_debuginfo.spec$ diff --git a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_debuginfo-stderr.txt b/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_debuginfo-stderr.txt deleted file mode 100644 index 86396db..0000000 --- a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_debuginfo-stderr.txt +++ /dev/null @@ -1,3 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/SINGLE_DEBUGINFO-build-no_debuginfo-subtest/_CPack_Packages/.*/RPM/SPECS/single_debuginfo-headers.spec -CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/SINGLE_DEBUGINFO-build-no_debuginfo-subtest/_CPack_Packages/.*/RPM/SPECS/single_debuginfo-libs.spec -CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/SINGLE_DEBUGINFO-build-no_debuginfo-subtest/_CPack_Packages/.*/RPM/SPECS/single_debuginfo.spec$ diff --git a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component-stderr.txt b/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component-stderr.txt deleted file mode 100644 index 080c4ff..0000000 --- a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/SINGLE_DEBUGINFO-build-one_component-subtest/_CPack_Packages/.*/RPM/SPECS/single_debuginfo-applications.spec$ diff --git a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component_main-stderr.txt b/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component_main-stderr.txt deleted file mode 100644 index 665597c..0000000 --- a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component_main-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/SINGLE_DEBUGINFO-build-one_component_main-subtest/_CPack_Packages/.*/RPM/SPECS/single_debuginfo.spec$ diff --git a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component_no_debuginfo-stderr.txt b/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component_no_debuginfo-stderr.txt deleted file mode 100644 index b64b1f5..0000000 --- a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-one_component_no_debuginfo-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/SINGLE_DEBUGINFO-build-one_component_no_debuginfo-subtest/_CPack_Packages/.*/RPM/SPECS/single_debuginfo-applications.spec$ diff --git a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-valid-stderr.txt b/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-valid-stderr.txt deleted file mode 100644 index f4c1bef..0000000 --- a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-valid-stderr.txt +++ /dev/null @@ -1,3 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/SINGLE_DEBUGINFO-build-valid-subtest/_CPack_Packages/.*/RPM/SPECS/single_debuginfo-headers.spec -CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/SINGLE_DEBUGINFO-build-valid-subtest/_CPack_Packages/.*/RPM/SPECS/single_debuginfo-libs.spec -CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/SINGLE_DEBUGINFO-build-valid-subtest/_CPack_Packages/.*/RPM/SPECS/single_debuginfo.spec$ diff --git a/Tests/RunCMake/CPack/RPM/default_expected_stderr.txt b/Tests/RunCMake/CPack/RPM/default_expected_stderr.txt new file mode 100644 index 0000000..4a0e4e6 --- /dev/null +++ b/Tests/RunCMake/CPack/RPM/default_expected_stderr.txt @@ -0,0 +1 @@ +^(CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM/CPack/[^-]*-build((-[^-]*-subtest/)|/)_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec(\n|$))*$ -- cgit v0.12 From 70b52a7113664b8b74b231d62ff798952d29ae1f Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sat, 26 Nov 2016 11:08:05 +0100 Subject: Tests: CPack test should use default package name Package names are irrelevant for most CPack tests so tests now set default package name that is created from test name and used if it is not explicitly provided in the test. --- Tests/RunCMake/CPack/CMakeLists.txt | 4 ++++ Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake | 2 -- Tests/RunCMake/CPack/CUSTOM_NAMES.cmake | 2 -- Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-ExpectedFiles.cmake | 2 +- Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-VerifyResult.cmake | 2 +- .../CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-ExpectedFiles.cmake | 2 +- .../CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-VerifyResult.cmake | 2 +- Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-ExpectedFiles.cmake | 4 ++-- Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-VerifyResult.cmake | 4 ++-- Tests/RunCMake/CPack/DEBUGINFO.cmake | 2 -- Tests/RunCMake/CPack/DEB_EXTRA.cmake | 1 - Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake | 2 -- Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake | 2 -- Tests/RunCMake/CPack/DEPENDENCIES.cmake | 2 -- Tests/RunCMake/CPack/EMPTY_DIR.cmake | 2 -- Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake | 2 -- Tests/RunCMake/CPack/LONG_FILENAMES.cmake | 2 -- Tests/RunCMake/CPack/MAIN_COMPONENT.cmake | 2 -- Tests/RunCMake/CPack/MINIMAL.cmake | 2 -- Tests/RunCMake/CPack/PACKAGE_CHECKSUM.cmake | 1 - Tests/RunCMake/CPack/PER_COMPONENT_FIELDS.cmake | 2 -- .../CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-ExpectedFiles.cmake | 2 +- Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-ExpectedFiles.cmake | 6 +++--- Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-VerifyResult.cmake | 4 ++-- Tests/RunCMake/CPack/RPM_DIST.cmake | 1 - Tests/RunCMake/CPack/RPM_SUGGESTS.cmake | 1 - Tests/RunCMake/CPack/SINGLE_DEBUGINFO.cmake | 2 -- Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake | 2 -- 28 files changed, 18 insertions(+), 46 deletions(-) diff --git a/Tests/RunCMake/CPack/CMakeLists.txt b/Tests/RunCMake/CPack/CMakeLists.txt index e42e971..409245e 100644 --- a/Tests/RunCMake/CPack/CMakeLists.txt +++ b/Tests/RunCMake/CPack/CMakeLists.txt @@ -1,6 +1,10 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) project(${RunCMake_TEST} CXX) + +# set default test name (can be overwritten in test.cmake or specifics.cmake) +string(TOLOWER "${RunCMake_TEST_FILE_PREFIX}" CPACK_PACKAGE_NAME) + include(${RunCMake_TEST_FILE_PREFIX}.cmake) # include test generator specifics diff --git a/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake b/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake index 7210e7d..9cd91af 100644 --- a/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake +++ b/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake @@ -1,5 +1,3 @@ set(CPACK_COMPONENTS_ALL test) install(DIRECTORY DESTINATION empty COMPONENT test) - -set(CPACK_PACKAGE_NAME "components_empty_dir") diff --git a/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake b/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake index c89df89..115864f 100644 --- a/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake +++ b/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake @@ -3,5 +3,3 @@ set(CPACK_RPM_COMPONENT_INSTALL "ON") install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_2) install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_3) - -set(CPACK_PACKAGE_NAME "custom_names") diff --git a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-ExpectedFiles.cmake index a8efb61..32a2327 100644 --- a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-ExpectedFiles.cmake @@ -1,6 +1,6 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "generate_shlibs_0.1.1-1_*.deb") +set(EXPECTED_FILE_1 "deb_generate_shlibs_0.1.1-1_*.deb") # dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-VerifyResult.cmake index b1952ef..f5d97db 100644 --- a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-VerifyResult.cmake +++ b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-VerifyResult.cmake @@ -1,4 +1,4 @@ -set(shlibs_shlibs "^libtest_lib 0\\.8 generate_shlibs \\(\\= 0\\.1\\.1\\)\n$") +set(shlibs_shlibs "^libtest_lib 0\\.8 deb_generate_shlibs \\(\\= 0\\.1\\.1\\)\n$") # optional dot at the end of permissions regex is for SELinux enabled systems set(shlibs_shlibs_permissions_regex "-rw-r--r--\.? .*") verifyDebControl("${FOUND_FILE_1}" "shlibs" "shlibs") diff --git a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-ExpectedFiles.cmake index 9a9dee3..4966818 100644 --- a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-ExpectedFiles.cmake @@ -1,6 +1,6 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "generate_shlibs_ldconfig_0.1.1-1_*.deb") +set(EXPECTED_FILE_1 "deb_generate_shlibs_ldconfig_0.1.1-1_*.deb") # dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it set(EXPECTED_FILE_CONTENT_1 "^.*/usr/lib${whitespaces_}.*/usr/lib/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-VerifyResult.cmake index 422cfbe..320732b 100644 --- a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-VerifyResult.cmake +++ b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-VerifyResult.cmake @@ -1,4 +1,4 @@ -set(shlibs_shlibs "^libtest_lib 0\\.8 generate_shlibs_ldconfig \\(>\\= 0\\.1\\.1\\)\n$") +set(shlibs_shlibs "^libtest_lib 0\\.8 deb_generate_shlibs_ldconfig \\(>\\= 0\\.1\\.1\\)\n$") # NOTE: optional dot at the end of permissions regex is for SELinux enabled systems set(shlibs_shlibs_permissions_regex "-rw-r--r--\.? .*") set(shlibs_postinst ".*ldconfig.*") diff --git a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-ExpectedFiles.cmake index 40f6730..11586a8 100644 --- a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-ExpectedFiles.cmake @@ -1,9 +1,9 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "3") -set(EXPECTED_FILE_1 "per_component-pkg_1_0.1.1-1_*.deb") +set(EXPECTED_FILE_1 "per_component_fields-pkg_1_0.1.1-1_*.deb") set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") set(EXPECTED_FILE_2 "second_0.1.1-1_*.deb") set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_3 "per_component-pkg_3_0.1.1-1_*.deb") +set(EXPECTED_FILE_3 "per_component_fields-pkg_3_0.1.1-1_*.deb") set(EXPECTED_FILE_CONTENT_3 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-VerifyResult.cmake index 55293be..0f69925 100644 --- a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-VerifyResult.cmake +++ b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-VerifyResult.cmake @@ -8,9 +8,9 @@ function(checkPackageInfo_ TYPE FILE REGEX) endfunction() # check package name -checkPackageInfo_("name" "${FOUND_FILE_1}" ".*Package${whitespaces_}:${whitespaces_}per_component-pkg_1") +checkPackageInfo_("name" "${FOUND_FILE_1}" ".*Package${whitespaces_}:${whitespaces_}per_component_fields-pkg_1") checkPackageInfo_("name" "${FOUND_FILE_2}" ".*Package${whitespaces_}:${whitespaces_}second") -checkPackageInfo_("name" "${FOUND_FILE_3}" ".*Package${whitespaces_}:${whitespaces_}per_component-pkg_3") +checkPackageInfo_("name" "${FOUND_FILE_3}" ".*Package${whitespaces_}:${whitespaces_}per_component_fields-pkg_3") # check package group checkPackageInfo_("group" "${FOUND_FILE_1}" ".*Section${whitespaces_}:${whitespaces_}default") diff --git a/Tests/RunCMake/CPack/DEBUGINFO.cmake b/Tests/RunCMake/CPack/DEBUGINFO.cmake index d98b682..70b3cb3 100644 --- a/Tests/RunCMake/CPack/DEBUGINFO.cmake +++ b/Tests/RunCMake/CPack/DEBUGINFO.cmake @@ -30,5 +30,3 @@ set(CPACK_RPM_APPLICATIONS_DEBUGINFO_PACKAGE ON) set(CPACK_RPM_LIBS_DEBUGINFO_PACKAGE ON) set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/src") - -set(CPACK_PACKAGE_NAME "debuginfo") diff --git a/Tests/RunCMake/CPack/DEB_EXTRA.cmake b/Tests/RunCMake/CPack/DEB_EXTRA.cmake index 189d123..754561d 100644 --- a/Tests/RunCMake/CPack/DEB_EXTRA.cmake +++ b/Tests/RunCMake/CPack/DEB_EXTRA.cmake @@ -32,7 +32,6 @@ endforeach() set(CPACK_DEBIAN_BAR_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/bar/preinst;${CMAKE_CURRENT_BINARY_DIR}/bar/prerm") -set(CPACK_PACKAGE_NAME "deb_extra") set(CPACK_PACKAGE_CONTACT "someone") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") diff --git a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake index 1aeb06f..fa0bc35 100644 --- a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake +++ b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake @@ -14,5 +14,3 @@ add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") set_target_properties(test_lib PROPERTIES SOVERSION "0.8") install(TARGETS test_lib DESTINATION foo COMPONENT libs) - -set(CPACK_PACKAGE_NAME "generate_shlibs") diff --git a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake index f58c876..2fc9e23 100644 --- a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake +++ b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake @@ -15,5 +15,3 @@ add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") set_target_properties(test_lib PROPERTIES SOVERSION "0.8") install(TARGETS test_lib LIBRARY DESTINATION lib COMPONENT libs NAMELINK_SKIP) - -set(CPACK_PACKAGE_NAME "generate_shlibs_ldconfig") diff --git a/Tests/RunCMake/CPack/DEPENDENCIES.cmake b/Tests/RunCMake/CPack/DEPENDENCIES.cmake index 4f6d65f..4499a7a 100644 --- a/Tests/RunCMake/CPack/DEPENDENCIES.cmake +++ b/Tests/RunCMake/CPack/DEPENDENCIES.cmake @@ -16,5 +16,3 @@ install(TARGETS test_prog DESTINATION foo_auto COMPONENT applications_auto) install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers) install(TARGETS test_lib DESTINATION bas COMPONENT libs) install(TARGETS test_lib DESTINATION bas_auto COMPONENT libs_auto) - -set(CPACK_PACKAGE_NAME "dependencies") diff --git a/Tests/RunCMake/CPack/EMPTY_DIR.cmake b/Tests/RunCMake/CPack/EMPTY_DIR.cmake index 023ba17..7bec17d 100644 --- a/Tests/RunCMake/CPack/EMPTY_DIR.cmake +++ b/Tests/RunCMake/CPack/EMPTY_DIR.cmake @@ -1,4 +1,2 @@ install(DIRECTORY DESTINATION empty COMPONENT test) - -set(CPACK_PACKAGE_NAME "empty_dir") diff --git a/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake b/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake index 13aa77b..9b3e856 100644 --- a/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake +++ b/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake @@ -22,5 +22,3 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh" install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo) install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar) - -set(CPACK_PACKAGE_NAME "install_scripts") diff --git a/Tests/RunCMake/CPack/LONG_FILENAMES.cmake b/Tests/RunCMake/CPack/LONG_FILENAMES.cmake index 3242aef..3370a50 100644 --- a/Tests/RunCMake/CPack/LONG_FILENAMES.cmake +++ b/Tests/RunCMake/CPack/LONG_FILENAMES.cmake @@ -6,5 +6,3 @@ file(WRITE "long_filename_test") install(FILES ${LONG_FILENAME} DESTINATION foo) - -set(CPACK_PACKAGE_NAME "long_filenames") diff --git a/Tests/RunCMake/CPack/MAIN_COMPONENT.cmake b/Tests/RunCMake/CPack/MAIN_COMPONENT.cmake index 99c6cae..f2c4451 100644 --- a/Tests/RunCMake/CPack/MAIN_COMPONENT.cmake +++ b/Tests/RunCMake/CPack/MAIN_COMPONENT.cmake @@ -10,5 +10,3 @@ else() set(CPACK_RPM_MAIN_COMPONENT "applications") set(CPACK_RPM_APPLICATIONS_FILE_NAME "RPM-DEFAULT") endif() - -set(CPACK_PACKAGE_NAME "main_component") diff --git a/Tests/RunCMake/CPack/MINIMAL.cmake b/Tests/RunCMake/CPack/MINIMAL.cmake index f29ad2a..83ed0f2 100644 --- a/Tests/RunCMake/CPack/MINIMAL.cmake +++ b/Tests/RunCMake/CPack/MINIMAL.cmake @@ -1,3 +1 @@ install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) - -set(CPACK_PACKAGE_NAME "minimal") diff --git a/Tests/RunCMake/CPack/PACKAGE_CHECKSUM.cmake b/Tests/RunCMake/CPack/PACKAGE_CHECKSUM.cmake index 5ca288c..0838063 100644 --- a/Tests/RunCMake/CPack/PACKAGE_CHECKSUM.cmake +++ b/Tests/RunCMake/CPack/PACKAGE_CHECKSUM.cmake @@ -1,4 +1,3 @@ install(FILES CMakeLists.txt DESTINATION foo) -set(CPACK_PACKAGE_NAME "package_checksum") set(CPACK_PACKAGE_CHECKSUM ${RunCMake_SUBTEST_SUFFIX}) diff --git a/Tests/RunCMake/CPack/PER_COMPONENT_FIELDS.cmake b/Tests/RunCMake/CPack/PER_COMPONENT_FIELDS.cmake index bb42cf4..703c1b7 100644 --- a/Tests/RunCMake/CPack/PER_COMPONENT_FIELDS.cmake +++ b/Tests/RunCMake/CPack/PER_COMPONENT_FIELDS.cmake @@ -1,5 +1,3 @@ install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_2) install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_3) - -set(CPACK_PACKAGE_NAME "per_component") diff --git a/Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-ExpectedFiles.cmake index 4e01f7b..ddaa9db 100644 --- a/Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-ExpectedFiles.cmake @@ -1,5 +1,5 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "PARTIALLY_RELOCATABLE_WARNING-0.1.1-*.rpm") +set(EXPECTED_FILE_1 "partially_relocatable_warning-0.1.1-*.rpm") set(EXPECTED_FILE_CONTENT_1 "^/not_relocatable${whitespaces_}/not_relocatable/CMakeLists.txt${whitespaces_}/opt$") diff --git a/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-ExpectedFiles.cmake index 3d28d41..b02ab8d 100644 --- a/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-ExpectedFiles.cmake @@ -1,9 +1,9 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "3") -set(EXPECTED_FILE_1 "per_component*-pkg_1.rpm") +set(EXPECTED_FILE_1 "per_component_fields*-pkg_1.rpm") set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_2 "per_component*-pkg_2.rpm") +set(EXPECTED_FILE_2 "per_component_fields*-pkg_2.rpm") set(EXPECTED_FILE_CONTENT_2 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_3 "per_component*-pkg_3.rpm") +set(EXPECTED_FILE_3 "per_component_fields*-pkg_3.rpm") set(EXPECTED_FILE_CONTENT_3 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-VerifyResult.cmake b/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-VerifyResult.cmake index d7d4f9d..1ff9a22 100644 --- a/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-VerifyResult.cmake +++ b/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-VerifyResult.cmake @@ -8,9 +8,9 @@ function(checkPackageInfo_ TYPE FILE REGEX) endfunction() # check package name -checkPackageInfo_("name" "${FOUND_FILE_1}" ".*Name${whitespaces_}:${whitespaces_}per_component-pkg_1") +checkPackageInfo_("name" "${FOUND_FILE_1}" ".*Name${whitespaces_}:${whitespaces_}per_component_fields-pkg_1") checkPackageInfo_("name" "${FOUND_FILE_2}" ".*Name${whitespaces_}:${whitespaces_}second") -checkPackageInfo_("name" "${FOUND_FILE_3}" ".*Name${whitespaces_}:${whitespaces_}per_component-pkg_3") +checkPackageInfo_("name" "${FOUND_FILE_3}" ".*Name${whitespaces_}:${whitespaces_}per_component_fields-pkg_3") # check package group checkPackageInfo_("group" "${FOUND_FILE_1}" ".*Group${whitespaces_}:${whitespaces_}default") diff --git a/Tests/RunCMake/CPack/RPM_DIST.cmake b/Tests/RunCMake/CPack/RPM_DIST.cmake index eb2a123..6bdd2c0 100644 --- a/Tests/RunCMake/CPack/RPM_DIST.cmake +++ b/Tests/RunCMake/CPack/RPM_DIST.cmake @@ -1,4 +1,3 @@ install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) -set(CPACK_PACKAGE_NAME "rpm_dist") diff --git a/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake b/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake index e6e0c1f..dc90ae8 100644 --- a/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake +++ b/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake @@ -1,4 +1,3 @@ install(FILES CMakeLists.txt DESTINATION foo) set(CPACK_RPM_PACKAGE_SUGGESTS "libsuggested") -set(CPACK_PACKAGE_NAME "rpm_suggests") diff --git a/Tests/RunCMake/CPack/SINGLE_DEBUGINFO.cmake b/Tests/RunCMake/CPack/SINGLE_DEBUGINFO.cmake index ae4995e..60e9038 100644 --- a/Tests/RunCMake/CPack/SINGLE_DEBUGINFO.cmake +++ b/Tests/RunCMake/CPack/SINGLE_DEBUGINFO.cmake @@ -52,5 +52,3 @@ if(RunCMake_SUBTEST_SUFFIX STREQUAL "valid" endif() set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/src") - -set(CPACK_PACKAGE_NAME "single_debuginfo") diff --git a/Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake b/Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake index 946439d..359b98f 100644 --- a/Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake +++ b/Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake @@ -5,5 +5,3 @@ add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") install(TARGETS test_prog DESTINATION foo COMPONENT applications) set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") - -set(CPACK_PACKAGE_NAME "source_package") -- cgit v0.12 From 53a69c7dd47f693efec85e031b89251dd7bdef2f Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sat, 26 Nov 2016 18:57:46 +0100 Subject: Tests: CPack move tests to separate dir For greater transparency tests are moved to a subfolder with each test having its own dir. --- Tests/RunCMake/CPack/CMakeLists.txt | 2 +- Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake | 3 -- Tests/RunCMake/CPack/CUSTOM_NAMES.cmake | 5 -- Tests/RunCMake/CPack/DEBUGINFO.cmake | 32 ------------- Tests/RunCMake/CPack/DEB_EXTRA.cmake | 38 --------------- Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake | 16 ------- .../CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake | 17 ------- Tests/RunCMake/CPack/DEPENDENCIES.cmake | 18 -------- Tests/RunCMake/CPack/EMPTY_DIR.cmake | 2 - Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake | 24 ---------- Tests/RunCMake/CPack/LONG_FILENAMES.cmake | 8 ---- Tests/RunCMake/CPack/MAIN_COMPONENT.cmake | 12 ----- Tests/RunCMake/CPack/MINIMAL.cmake | 1 - Tests/RunCMake/CPack/PACKAGE_CHECKSUM.cmake | 3 -- .../CPack/PARTIALLY_RELOCATABLE_WARNING.cmake | 6 --- Tests/RunCMake/CPack/PER_COMPONENT_FIELDS.cmake | 3 -- Tests/RunCMake/CPack/RPM_DIST.cmake | 3 -- Tests/RunCMake/CPack/RPM_SUGGESTS.cmake | 3 -- Tests/RunCMake/CPack/SINGLE_DEBUGINFO.cmake | 54 ---------------------- Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake | 7 --- .../CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake | 3 ++ Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake | 5 ++ Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake | 32 +++++++++++++ Tests/RunCMake/CPack/tests/DEB_EXTRA/test.cmake | 38 +++++++++++++++ .../CPack/tests/DEB_GENERATE_SHLIBS/test.cmake | 16 +++++++ .../tests/DEB_GENERATE_SHLIBS_LDCONFIG/test.cmake | 17 +++++++ Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake | 18 ++++++++ Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake | 2 + .../CPack/tests/INSTALL_SCRIPTS/test.cmake | 24 ++++++++++ .../RunCMake/CPack/tests/LONG_FILENAMES/test.cmake | 8 ++++ .../RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake | 12 +++++ Tests/RunCMake/CPack/tests/MINIMAL/test.cmake | 1 + .../CPack/tests/PACKAGE_CHECKSUM/test.cmake | 3 ++ .../tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake | 6 +++ .../CPack/tests/PER_COMPONENT_FIELDS/test.cmake | 3 ++ Tests/RunCMake/CPack/tests/RPM_DIST/test.cmake | 3 ++ Tests/RunCMake/CPack/tests/RPM_SUGGESTS/test.cmake | 3 ++ .../CPack/tests/SINGLE_DEBUGINFO/test.cmake | 54 ++++++++++++++++++++++ .../RunCMake/CPack/tests/SOURCE_PACKAGE/test.cmake | 7 +++ 39 files changed, 256 insertions(+), 256 deletions(-) delete mode 100644 Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake delete mode 100644 Tests/RunCMake/CPack/CUSTOM_NAMES.cmake delete mode 100644 Tests/RunCMake/CPack/DEBUGINFO.cmake delete mode 100644 Tests/RunCMake/CPack/DEB_EXTRA.cmake delete mode 100644 Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake delete mode 100644 Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake delete mode 100644 Tests/RunCMake/CPack/DEPENDENCIES.cmake delete mode 100644 Tests/RunCMake/CPack/EMPTY_DIR.cmake delete mode 100644 Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake delete mode 100644 Tests/RunCMake/CPack/LONG_FILENAMES.cmake delete mode 100644 Tests/RunCMake/CPack/MAIN_COMPONENT.cmake delete mode 100644 Tests/RunCMake/CPack/MINIMAL.cmake delete mode 100644 Tests/RunCMake/CPack/PACKAGE_CHECKSUM.cmake delete mode 100644 Tests/RunCMake/CPack/PARTIALLY_RELOCATABLE_WARNING.cmake delete mode 100644 Tests/RunCMake/CPack/PER_COMPONENT_FIELDS.cmake delete mode 100644 Tests/RunCMake/CPack/RPM_DIST.cmake delete mode 100644 Tests/RunCMake/CPack/RPM_SUGGESTS.cmake delete mode 100644 Tests/RunCMake/CPack/SINGLE_DEBUGINFO.cmake delete mode 100644 Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake create mode 100644 Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEB_EXTRA/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/MINIMAL/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/RPM_DIST/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/RPM_SUGGESTS/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/test.cmake diff --git a/Tests/RunCMake/CPack/CMakeLists.txt b/Tests/RunCMake/CPack/CMakeLists.txt index 409245e..c4d9d5d 100644 --- a/Tests/RunCMake/CPack/CMakeLists.txt +++ b/Tests/RunCMake/CPack/CMakeLists.txt @@ -5,7 +5,7 @@ project(${RunCMake_TEST} CXX) # set default test name (can be overwritten in test.cmake or specifics.cmake) string(TOLOWER "${RunCMake_TEST_FILE_PREFIX}" CPACK_PACKAGE_NAME) -include(${RunCMake_TEST_FILE_PREFIX}.cmake) +include(tests/${RunCMake_TEST_FILE_PREFIX}/test.cmake) # include test generator specifics if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${GENERATOR_TYPE}/${RunCMake_TEST_FILE_PREFIX}-specifics.cmake") diff --git a/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake b/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake deleted file mode 100644 index 9cd91af..0000000 --- a/Tests/RunCMake/CPack/COMPONENTS_EMPTY_DIR.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set(CPACK_COMPONENTS_ALL test) -install(DIRECTORY DESTINATION empty - COMPONENT test) diff --git a/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake b/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake deleted file mode 100644 index 115864f..0000000 --- a/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(CPACK_RPM_COMPONENT_INSTALL "ON") - -install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) -install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_2) -install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_3) diff --git a/Tests/RunCMake/CPack/DEBUGINFO.cmake b/Tests/RunCMake/CPack/DEBUGINFO.cmake deleted file mode 100644 index 70b3cb3..0000000 --- a/Tests/RunCMake/CPack/DEBUGINFO.cmake +++ /dev/null @@ -1,32 +0,0 @@ -set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) - -# PGI compiler doesn't add build id to binaries by default -if(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") - string(APPEND CMAKE_EXE_LINKER_FLAGS "-Wl,--build-id") - string(APPEND CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id") -endif() - -set(CPACK_RPM_COMPONENT_INSTALL "ON") - -set(CMAKE_BUILD_TYPE Debug) - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" - "int test_lib();\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" - "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") -add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" - "#include \"test_lib.hpp\"\nint main() {return test_lib();}\n") -add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") -target_link_libraries(test_prog test_lib) - -install(TARGETS test_prog DESTINATION foo COMPONENT applications) -install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers) -install(TARGETS test_lib DESTINATION bas COMPONENT libs) - -set(CPACK_RPM_APPLICATIONS_FILE_NAME "RPM-DEFAULT") -set(CPACK_RPM_APPLICATIONS_DEBUGINFO_PACKAGE ON) -set(CPACK_RPM_LIBS_DEBUGINFO_PACKAGE ON) - -set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/src") diff --git a/Tests/RunCMake/CPack/DEB_EXTRA.cmake b/Tests/RunCMake/CPack/DEB_EXTRA.cmake deleted file mode 100644 index 754561d..0000000 --- a/Tests/RunCMake/CPack/DEB_EXTRA.cmake +++ /dev/null @@ -1,38 +0,0 @@ -install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo) -install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar) -install(FILES CMakeLists.txt DESTINATION bas COMPONENT bas) - -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/preinst "echo default_preinst") -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/prerm "echo default_prerm") - -foreach(file_ preinst prerm) - file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/${file_} - DESTINATION ${CMAKE_CURRENT_BINARY_DIR} - FILE_PERMISSIONS - OWNER_READ OWNER_WRITE OWNER_EXECUTE - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE) -endforeach() - -set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA - "${CMAKE_CURRENT_BINARY_DIR}/preinst;${CMAKE_CURRENT_BINARY_DIR}/prerm;${CMAKE_CURRENT_BINARY_DIR}/conffiles") - -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/preinst "echo bar_preinst") -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/prerm "echo bar_prerm") - -foreach(file_ preinst prerm) - # not acceptable permissions for lintian but we need to check that - # permissions are preserved - file(COPY ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/${file_} - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bar - FILE_PERMISSIONS - OWNER_READ OWNER_WRITE OWNER_EXECUTE) -endforeach() - -set(CPACK_DEBIAN_BAR_PACKAGE_CONTROL_EXTRA - "${CMAKE_CURRENT_BINARY_DIR}/bar/preinst;${CMAKE_CURRENT_BINARY_DIR}/bar/prerm") - -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - -set(CPACK_DEB_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake deleted file mode 100644 index fa0bc35..0000000 --- a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake +++ /dev/null @@ -1,16 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") -set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - -set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") - -set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" - "int test_lib();\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" - "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") -add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") -set_target_properties(test_lib PROPERTIES SOVERSION "0.8") - -install(TARGETS test_lib DESTINATION foo COMPONENT libs) diff --git a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake deleted file mode 100644 index 2fc9e23..0000000 --- a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake +++ /dev/null @@ -1,17 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") -set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - -set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") -set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=") - -set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" - "int test_lib();\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" - "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") -add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") -set_target_properties(test_lib PROPERTIES SOVERSION "0.8") - -install(TARGETS test_lib LIBRARY DESTINATION lib COMPONENT libs NAMELINK_SKIP) diff --git a/Tests/RunCMake/CPack/DEPENDENCIES.cmake b/Tests/RunCMake/CPack/DEPENDENCIES.cmake deleted file mode 100644 index 4499a7a..0000000 --- a/Tests/RunCMake/CPack/DEPENDENCIES.cmake +++ /dev/null @@ -1,18 +0,0 @@ -set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" - "int test_lib();\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" - "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") -add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" - "#include \"test_lib.hpp\"\nint main() {return test_lib();}\n") -add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") -target_link_libraries(test_prog test_lib) - -install(TARGETS test_prog DESTINATION foo COMPONENT applications) -install(TARGETS test_prog DESTINATION foo_auto COMPONENT applications_auto) -install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers) -install(TARGETS test_lib DESTINATION bas COMPONENT libs) -install(TARGETS test_lib DESTINATION bas_auto COMPONENT libs_auto) diff --git a/Tests/RunCMake/CPack/EMPTY_DIR.cmake b/Tests/RunCMake/CPack/EMPTY_DIR.cmake deleted file mode 100644 index 7bec17d..0000000 --- a/Tests/RunCMake/CPack/EMPTY_DIR.cmake +++ /dev/null @@ -1,2 +0,0 @@ -install(DIRECTORY DESTINATION empty - COMPONENT test) diff --git a/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake b/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake deleted file mode 100644 index 9b3e856..0000000 --- a/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake +++ /dev/null @@ -1,24 +0,0 @@ -set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) - -# default -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh" - "echo \"pre install\"\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_install.sh" - "echo \"post install\"\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh" - "echo \"pre uninstall\"\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh" - "echo \"post uninstall\"\n") - -# specific -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh" - "echo \"pre install foo\"\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_install_foo.sh" - "echo \"post install foo\"\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh" - "echo \"pre uninstall foo\"\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh" - "echo \"post uninstall foo\"\n") - -install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo) -install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar) diff --git a/Tests/RunCMake/CPack/LONG_FILENAMES.cmake b/Tests/RunCMake/CPack/LONG_FILENAMES.cmake deleted file mode 100644 index 3370a50..0000000 --- a/Tests/RunCMake/CPack/LONG_FILENAMES.cmake +++ /dev/null @@ -1,8 +0,0 @@ -set(LONG_FILENAME - "${CMAKE_CURRENT_BINARY_DIR}/llllllllll_oooooooooo_nnnnnnnnnn_gggggggggg_ffffffffff_iiiiiiiiii_llllllllll_eeeeeeeeee_nnnnnnnnnn_aaaaaaaaaa_mmmmmmmmmm_eeeeeeeeee.txt") - -file(WRITE - "${LONG_FILENAME}" - "long_filename_test") - -install(FILES ${LONG_FILENAME} DESTINATION foo) diff --git a/Tests/RunCMake/CPack/MAIN_COMPONENT.cmake b/Tests/RunCMake/CPack/MAIN_COMPONENT.cmake deleted file mode 100644 index f2c4451..0000000 --- a/Tests/RunCMake/CPack/MAIN_COMPONENT.cmake +++ /dev/null @@ -1,12 +0,0 @@ -set(CPACK_RPM_COMPONENT_INSTALL "ON") - -install(FILES CMakeLists.txt DESTINATION foo COMPONENT applications) -install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers) -install(FILES CMakeLists.txt DESTINATION bas COMPONENT libs) - -if(RunCMake_SUBTEST_SUFFIX STREQUAL "invalid") - set(CPACK_RPM_MAIN_COMPONENT "") -else() - set(CPACK_RPM_MAIN_COMPONENT "applications") - set(CPACK_RPM_APPLICATIONS_FILE_NAME "RPM-DEFAULT") -endif() diff --git a/Tests/RunCMake/CPack/MINIMAL.cmake b/Tests/RunCMake/CPack/MINIMAL.cmake deleted file mode 100644 index 83ed0f2..0000000 --- a/Tests/RunCMake/CPack/MINIMAL.cmake +++ /dev/null @@ -1 +0,0 @@ -install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) diff --git a/Tests/RunCMake/CPack/PACKAGE_CHECKSUM.cmake b/Tests/RunCMake/CPack/PACKAGE_CHECKSUM.cmake deleted file mode 100644 index 0838063..0000000 --- a/Tests/RunCMake/CPack/PACKAGE_CHECKSUM.cmake +++ /dev/null @@ -1,3 +0,0 @@ -install(FILES CMakeLists.txt DESTINATION foo) - -set(CPACK_PACKAGE_CHECKSUM ${RunCMake_SUBTEST_SUFFIX}) diff --git a/Tests/RunCMake/CPack/PARTIALLY_RELOCATABLE_WARNING.cmake b/Tests/RunCMake/CPack/PARTIALLY_RELOCATABLE_WARNING.cmake deleted file mode 100644 index 31e729b..0000000 --- a/Tests/RunCMake/CPack/PARTIALLY_RELOCATABLE_WARNING.cmake +++ /dev/null @@ -1,6 +0,0 @@ -install(FILES CMakeLists.txt DESTINATION /not_relocatable COMPONENT static) - -set(CPACK_PACKAGE_RELOCATABLE TRUE) -set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") - -set(CPACK_RPM_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPack/PER_COMPONENT_FIELDS.cmake b/Tests/RunCMake/CPack/PER_COMPONENT_FIELDS.cmake deleted file mode 100644 index 703c1b7..0000000 --- a/Tests/RunCMake/CPack/PER_COMPONENT_FIELDS.cmake +++ /dev/null @@ -1,3 +0,0 @@ -install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) -install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_2) -install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_3) diff --git a/Tests/RunCMake/CPack/RPM_DIST.cmake b/Tests/RunCMake/CPack/RPM_DIST.cmake deleted file mode 100644 index 6bdd2c0..0000000 --- a/Tests/RunCMake/CPack/RPM_DIST.cmake +++ /dev/null @@ -1,3 +0,0 @@ -install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) - -set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) diff --git a/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake b/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake deleted file mode 100644 index dc90ae8..0000000 --- a/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake +++ /dev/null @@ -1,3 +0,0 @@ -install(FILES CMakeLists.txt DESTINATION foo) - -set(CPACK_RPM_PACKAGE_SUGGESTS "libsuggested") diff --git a/Tests/RunCMake/CPack/SINGLE_DEBUGINFO.cmake b/Tests/RunCMake/CPack/SINGLE_DEBUGINFO.cmake deleted file mode 100644 index 60e9038..0000000 --- a/Tests/RunCMake/CPack/SINGLE_DEBUGINFO.cmake +++ /dev/null @@ -1,54 +0,0 @@ -set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) - -# PGI compiler doesn't add build id to binaries by default -if(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") - string(APPEND CMAKE_EXE_LINKER_FLAGS "-Wl,--build-id") - string(APPEND CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id") -endif() - -if(NOT RunCMake_SUBTEST_SUFFIX STREQUAL "no_components") - set(CPACK_RPM_COMPONENT_INSTALL "ON") -endif() - -set(CMAKE_BUILD_TYPE Debug) - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" - "int test_lib();\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" - "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") -add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" - "#include \"test_lib.hpp\"\nint main() {return test_lib();}\n") -add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") -target_link_libraries(test_prog test_lib) - -install(TARGETS test_prog DESTINATION foo COMPONENT applications) - -if(RunCMake_SUBTEST_SUFFIX STREQUAL "valid" - OR RunCMake_SUBTEST_SUFFIX STREQUAL "no_main_component" - OR RunCMake_SUBTEST_SUFFIX STREQUAL "no_debuginfo") - install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers) - install(TARGETS test_lib DESTINATION bas COMPONENT libs) -elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "one_component" - OR RunCMake_SUBTEST_SUFFIX STREQUAL "one_component_no_debuginfo") - set(CPACK_COMPONENTS_ALL applications) -endif() - -set(CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE ON) - -if(RunCMake_SUBTEST_SUFFIX STREQUAL "valid" - OR RunCMake_SUBTEST_SUFFIX STREQUAL "one_component_main" - OR RunCMake_SUBTEST_SUFFIX STREQUAL "no_debuginfo") - set(CPACK_RPM_MAIN_COMPONENT "applications") - set(CPACK_RPM_APPLICATIONS_FILE_NAME "RPM-DEFAULT") -endif() - -if(RunCMake_SUBTEST_SUFFIX STREQUAL "valid" - OR RunCMake_SUBTEST_SUFFIX STREQUAL "no_main_component" - OR RunCMake_SUBTEST_SUFFIX STREQUAL "one_component") - set(CPACK_RPM_APPLICATIONS_DEBUGINFO_PACKAGE ON) - set(CPACK_RPM_LIBS_DEBUGINFO_PACKAGE ON) -endif() - -set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/src") diff --git a/Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake b/Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake deleted file mode 100644 index 359b98f..0000000 --- a/Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake +++ /dev/null @@ -1,7 +0,0 @@ -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" - "int main() {return 0;}\n") -add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") - -install(TARGETS test_prog DESTINATION foo COMPONENT applications) - -set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") diff --git a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake new file mode 100644 index 0000000..9cd91af --- /dev/null +++ b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake @@ -0,0 +1,3 @@ +set(CPACK_COMPONENTS_ALL test) +install(DIRECTORY DESTINATION empty + COMPONENT test) diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake new file mode 100644 index 0000000..115864f --- /dev/null +++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake @@ -0,0 +1,5 @@ +set(CPACK_RPM_COMPONENT_INSTALL "ON") + +install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) +install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_2) +install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_3) diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake new file mode 100644 index 0000000..70b3cb3 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake @@ -0,0 +1,32 @@ +set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) + +# PGI compiler doesn't add build id to binaries by default +if(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") + string(APPEND CMAKE_EXE_LINKER_FLAGS "-Wl,--build-id") + string(APPEND CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id") +endif() + +set(CPACK_RPM_COMPONENT_INSTALL "ON") + +set(CMAKE_BUILD_TYPE Debug) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" + "int test_lib();\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" + "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") +add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "#include \"test_lib.hpp\"\nint main() {return test_lib();}\n") +add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +target_link_libraries(test_prog test_lib) + +install(TARGETS test_prog DESTINATION foo COMPONENT applications) +install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers) +install(TARGETS test_lib DESTINATION bas COMPONENT libs) + +set(CPACK_RPM_APPLICATIONS_FILE_NAME "RPM-DEFAULT") +set(CPACK_RPM_APPLICATIONS_DEBUGINFO_PACKAGE ON) +set(CPACK_RPM_LIBS_DEBUGINFO_PACKAGE ON) + +set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/src") diff --git a/Tests/RunCMake/CPack/tests/DEB_EXTRA/test.cmake b/Tests/RunCMake/CPack/tests/DEB_EXTRA/test.cmake new file mode 100644 index 0000000..754561d --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEB_EXTRA/test.cmake @@ -0,0 +1,38 @@ +install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo) +install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar) +install(FILES CMakeLists.txt DESTINATION bas COMPONENT bas) + +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/preinst "echo default_preinst") +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/prerm "echo default_prerm") + +foreach(file_ preinst prerm) + file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/${file_} + DESTINATION ${CMAKE_CURRENT_BINARY_DIR} + FILE_PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) +endforeach() + +set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA + "${CMAKE_CURRENT_BINARY_DIR}/preinst;${CMAKE_CURRENT_BINARY_DIR}/prerm;${CMAKE_CURRENT_BINARY_DIR}/conffiles") + +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/preinst "echo bar_preinst") +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/prerm "echo bar_prerm") + +foreach(file_ preinst prerm) + # not acceptable permissions for lintian but we need to check that + # permissions are preserved + file(COPY ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/${file_} + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bar + FILE_PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE) +endforeach() + +set(CPACK_DEBIAN_BAR_PACKAGE_CONTROL_EXTRA + "${CMAKE_CURRENT_BINARY_DIR}/bar/preinst;${CMAKE_CURRENT_BINARY_DIR}/bar/prerm") + +set(CPACK_PACKAGE_CONTACT "someone") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") + +set(CPACK_DEB_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/test.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/test.cmake new file mode 100644 index 0000000..fa0bc35 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/test.cmake @@ -0,0 +1,16 @@ +set(CPACK_PACKAGE_CONTACT "someone") +set(CPACK_DEB_COMPONENT_INSTALL "ON") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") + +set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") + +set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" + "int test_lib();\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" + "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") +add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") +set_target_properties(test_lib PROPERTIES SOVERSION "0.8") + +install(TARGETS test_lib DESTINATION foo COMPONENT libs) diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/test.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/test.cmake new file mode 100644 index 0000000..2fc9e23 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/test.cmake @@ -0,0 +1,17 @@ +set(CPACK_PACKAGE_CONTACT "someone") +set(CPACK_DEB_COMPONENT_INSTALL "ON") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") + +set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") +set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=") + +set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" + "int test_lib();\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" + "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") +add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") +set_target_properties(test_lib PROPERTIES SOVERSION "0.8") + +install(TARGETS test_lib LIBRARY DESTINATION lib COMPONENT libs NAMELINK_SKIP) diff --git a/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake b/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake new file mode 100644 index 0000000..4499a7a --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake @@ -0,0 +1,18 @@ +set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" + "int test_lib();\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" + "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") +add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "#include \"test_lib.hpp\"\nint main() {return test_lib();}\n") +add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +target_link_libraries(test_prog test_lib) + +install(TARGETS test_prog DESTINATION foo COMPONENT applications) +install(TARGETS test_prog DESTINATION foo_auto COMPONENT applications_auto) +install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers) +install(TARGETS test_lib DESTINATION bas COMPONENT libs) +install(TARGETS test_lib DESTINATION bas_auto COMPONENT libs_auto) diff --git a/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake b/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake new file mode 100644 index 0000000..7bec17d --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake @@ -0,0 +1,2 @@ +install(DIRECTORY DESTINATION empty + COMPONENT test) diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake new file mode 100644 index 0000000..9b3e856 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake @@ -0,0 +1,24 @@ +set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) + +# default +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh" + "echo \"pre install\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_install.sh" + "echo \"post install\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh" + "echo \"pre uninstall\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh" + "echo \"post uninstall\"\n") + +# specific +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh" + "echo \"pre install foo\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_install_foo.sh" + "echo \"post install foo\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh" + "echo \"pre uninstall foo\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh" + "echo \"post uninstall foo\"\n") + +install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo) +install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar) diff --git a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake new file mode 100644 index 0000000..3370a50 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake @@ -0,0 +1,8 @@ +set(LONG_FILENAME + "${CMAKE_CURRENT_BINARY_DIR}/llllllllll_oooooooooo_nnnnnnnnnn_gggggggggg_ffffffffff_iiiiiiiiii_llllllllll_eeeeeeeeee_nnnnnnnnnn_aaaaaaaaaa_mmmmmmmmmm_eeeeeeeeee.txt") + +file(WRITE + "${LONG_FILENAME}" + "long_filename_test") + +install(FILES ${LONG_FILENAME} DESTINATION foo) diff --git a/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake new file mode 100644 index 0000000..f2c4451 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake @@ -0,0 +1,12 @@ +set(CPACK_RPM_COMPONENT_INSTALL "ON") + +install(FILES CMakeLists.txt DESTINATION foo COMPONENT applications) +install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers) +install(FILES CMakeLists.txt DESTINATION bas COMPONENT libs) + +if(RunCMake_SUBTEST_SUFFIX STREQUAL "invalid") + set(CPACK_RPM_MAIN_COMPONENT "") +else() + set(CPACK_RPM_MAIN_COMPONENT "applications") + set(CPACK_RPM_APPLICATIONS_FILE_NAME "RPM-DEFAULT") +endif() diff --git a/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake b/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake new file mode 100644 index 0000000..83ed0f2 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake @@ -0,0 +1 @@ +install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) diff --git a/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/test.cmake b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/test.cmake new file mode 100644 index 0000000..0838063 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/test.cmake @@ -0,0 +1,3 @@ +install(FILES CMakeLists.txt DESTINATION foo) + +set(CPACK_PACKAGE_CHECKSUM ${RunCMake_SUBTEST_SUFFIX}) diff --git a/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake b/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake new file mode 100644 index 0000000..31e729b --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake @@ -0,0 +1,6 @@ +install(FILES CMakeLists.txt DESTINATION /not_relocatable COMPONENT static) + +set(CPACK_PACKAGE_RELOCATABLE TRUE) +set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") + +set(CPACK_RPM_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake new file mode 100644 index 0000000..703c1b7 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake @@ -0,0 +1,3 @@ +install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) +install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_2) +install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_3) diff --git a/Tests/RunCMake/CPack/tests/RPM_DIST/test.cmake b/Tests/RunCMake/CPack/tests/RPM_DIST/test.cmake new file mode 100644 index 0000000..6bdd2c0 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/RPM_DIST/test.cmake @@ -0,0 +1,3 @@ +install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) + +set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) diff --git a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/test.cmake b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/test.cmake new file mode 100644 index 0000000..dc90ae8 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/test.cmake @@ -0,0 +1,3 @@ +install(FILES CMakeLists.txt DESTINATION foo) + +set(CPACK_RPM_PACKAGE_SUGGESTS "libsuggested") diff --git a/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/test.cmake b/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/test.cmake new file mode 100644 index 0000000..60e9038 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/test.cmake @@ -0,0 +1,54 @@ +set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) + +# PGI compiler doesn't add build id to binaries by default +if(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") + string(APPEND CMAKE_EXE_LINKER_FLAGS "-Wl,--build-id") + string(APPEND CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id") +endif() + +if(NOT RunCMake_SUBTEST_SUFFIX STREQUAL "no_components") + set(CPACK_RPM_COMPONENT_INSTALL "ON") +endif() + +set(CMAKE_BUILD_TYPE Debug) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" + "int test_lib();\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" + "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") +add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "#include \"test_lib.hpp\"\nint main() {return test_lib();}\n") +add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +target_link_libraries(test_prog test_lib) + +install(TARGETS test_prog DESTINATION foo COMPONENT applications) + +if(RunCMake_SUBTEST_SUFFIX STREQUAL "valid" + OR RunCMake_SUBTEST_SUFFIX STREQUAL "no_main_component" + OR RunCMake_SUBTEST_SUFFIX STREQUAL "no_debuginfo") + install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers) + install(TARGETS test_lib DESTINATION bas COMPONENT libs) +elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "one_component" + OR RunCMake_SUBTEST_SUFFIX STREQUAL "one_component_no_debuginfo") + set(CPACK_COMPONENTS_ALL applications) +endif() + +set(CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE ON) + +if(RunCMake_SUBTEST_SUFFIX STREQUAL "valid" + OR RunCMake_SUBTEST_SUFFIX STREQUAL "one_component_main" + OR RunCMake_SUBTEST_SUFFIX STREQUAL "no_debuginfo") + set(CPACK_RPM_MAIN_COMPONENT "applications") + set(CPACK_RPM_APPLICATIONS_FILE_NAME "RPM-DEFAULT") +endif() + +if(RunCMake_SUBTEST_SUFFIX STREQUAL "valid" + OR RunCMake_SUBTEST_SUFFIX STREQUAL "no_main_component" + OR RunCMake_SUBTEST_SUFFIX STREQUAL "one_component") + set(CPACK_RPM_APPLICATIONS_DEBUGINFO_PACKAGE ON) + set(CPACK_RPM_LIBS_DEBUGINFO_PACKAGE ON) +endif() + +set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/src") diff --git a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/test.cmake b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/test.cmake new file mode 100644 index 0000000..359b98f --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/test.cmake @@ -0,0 +1,7 @@ +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main() {return 0;}\n") +add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") + +install(TARGETS test_prog DESTINATION foo COMPONENT applications) + +set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") -- cgit v0.12 From 46b6a25adaa3ce4326247263de426399be409a29 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sat, 26 Nov 2016 19:27:49 +0100 Subject: Tests: CPack test move std error files to test files --- Tests/RunCMake/CPack/CPackTestHelpers.cmake | 8 ++++---- Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-invalid-stderr.txt | 1 - Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-stderr.txt | 1 - .../CPack/RPM/SINGLE_DEBUGINFO-no_main_component-stderr.txt | 1 - Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-invalid-stderr.txt | 2 -- Tests/RunCMake/CPack/tests/MAIN_COMPONENT/RPM-invalid-stderr.txt | 1 + .../RunCMake/CPack/tests/PACKAGE_CHECKSUM/TGZ-invalid-stderr.txt | 2 ++ .../CPack/tests/PARTIALLY_RELOCATABLE_WARNING/RPM-stderr.txt | 1 + .../CPack/tests/SINGLE_DEBUGINFO/RPM-no_main_component-stderr.txt | 1 + 9 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-invalid-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-stderr.txt delete mode 100644 Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_main_component-stderr.txt delete mode 100644 Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-invalid-stderr.txt create mode 100644 Tests/RunCMake/CPack/tests/MAIN_COMPONENT/RPM-invalid-stderr.txt create mode 100644 Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/TGZ-invalid-stderr.txt create mode 100644 Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/RPM-stderr.txt create mode 100644 Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/RPM-no_main_component-stderr.txt diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake index cf8ae23..94be2f9 100644 --- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake +++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake @@ -57,10 +57,10 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source) ) foreach(o out err) - if(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/${TEST_TYPE}/${TEST_NAME}-${SUBTEST_SUFFIX}-std${o}.txt) - set(RunCMake-std${o}-file "${TEST_TYPE}/${TEST_NAME}-${SUBTEST_SUFFIX}-std${o}.txt") - elseif(EXISTS ${RunCMake_SOURCE_DIR}/${TEST_TYPE}/${TEST_NAME}-std${o}.txt) - set(RunCMake-std${o}-file "${TEST_TYPE}/${TEST_NAME}-std${o}.txt") + if(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt) + set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt") + elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-std${o}.txt) + set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-std${o}.txt") elseif(EXISTS ${RunCMake_SOURCE_DIR}/${TEST_TYPE}/default_expected_std${o}.txt) set(RunCMake-std${o}-file "${TEST_TYPE}/default_expected_std${o}.txt") endif() diff --git a/Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-invalid-stderr.txt b/Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-invalid-stderr.txt deleted file mode 100644 index 4d8ac6e..0000000 --- a/Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-invalid-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -CPACK_RPM_MAIN_COMPONENT set to non existing component. diff --git a/Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-stderr.txt b/Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-stderr.txt deleted file mode 100644 index 3b63d5b..0000000 --- a/Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -CPackRPM:Warning: Path /not_relocatable/CMakeLists.txt is not on one of the.*relocatable paths! Package will be partially relocatable. diff --git a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_main_component-stderr.txt b/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_main_component-stderr.txt deleted file mode 100644 index 454283c..0000000 --- a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-no_main_component-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -CPack Error: CPACK_RPM_MAIN_COMPONENT not set but it is mandatory with CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE being set. diff --git a/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-invalid-stderr.txt b/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-invalid-stderr.txt deleted file mode 100644 index abf6d8c..0000000 --- a/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-invalid-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -^CPack Error: Cannot recognize algorithm: invalid -CPack Error: Error when generating package: package_checksum$ diff --git a/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/RPM-invalid-stderr.txt b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/RPM-invalid-stderr.txt new file mode 100644 index 0000000..4d8ac6e --- /dev/null +++ b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/RPM-invalid-stderr.txt @@ -0,0 +1 @@ +CPACK_RPM_MAIN_COMPONENT set to non existing component. diff --git a/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/TGZ-invalid-stderr.txt b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/TGZ-invalid-stderr.txt new file mode 100644 index 0000000..abf6d8c --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/TGZ-invalid-stderr.txt @@ -0,0 +1,2 @@ +^CPack Error: Cannot recognize algorithm: invalid +CPack Error: Error when generating package: package_checksum$ diff --git a/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/RPM-stderr.txt b/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/RPM-stderr.txt new file mode 100644 index 0000000..3b63d5b --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/RPM-stderr.txt @@ -0,0 +1 @@ +CPackRPM:Warning: Path /not_relocatable/CMakeLists.txt is not on one of the.*relocatable paths! Package will be partially relocatable. diff --git a/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/RPM-no_main_component-stderr.txt b/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/RPM-no_main_component-stderr.txt new file mode 100644 index 0000000..454283c --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/RPM-no_main_component-stderr.txt @@ -0,0 +1 @@ +CPack Error: CPACK_RPM_MAIN_COMPONENT not set but it is mandatory with CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE being set. -- cgit v0.12 From a0ad6fc4dc55541f66534abcf050aaf63c65033f Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sat, 26 Nov 2016 11:16:28 +0100 Subject: Tests: CPack test should always check test output --- Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake | 2 -- Tests/RunCMake/CPack/VerifyResult.cmake | 8 +++----- Tests/RunCMake/CPack/tests/DEPENDENCIES/DEB-stderr.txt | 1 + Tests/RunCMake/CPack/tests/RPM_SUGGESTS/RPM-stderr.txt | 1 + 4 files changed, 5 insertions(+), 7 deletions(-) create mode 100644 Tests/RunCMake/CPack/tests/DEPENDENCIES/DEB-stderr.txt create mode 100644 Tests/RunCMake/CPack/tests/RPM_SUGGESTS/RPM-stderr.txt diff --git a/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake b/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake index e9e65d6..e4f9618 100644 --- a/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake +++ b/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake @@ -9,6 +9,4 @@ if(NOT ${RunCMake_SUBTEST_SUFFIX} MATCHES "invalid") if(NOT expected_value STREQUAL CHSUM_VALUE) message(FATAL_ERROR "Generated checksum is not valid! Expected [${expected_value}] Got [${CHSUM_VALUE}]") endif() -else() - message(${error}) endif() diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake index ad2a651..539cef6 100644 --- a/Tests/RunCMake/CPack/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/VerifyResult.cmake @@ -86,9 +86,7 @@ endif() # handle additional result verifications if(EXISTS "${src_dir}/${GENERATOR_TYPE}/${RunCMake_TEST_FILE_PREFIX}-VerifyResult.cmake") include("${src_dir}/${GENERATOR_TYPE}/${RunCMake_TEST_FILE_PREFIX}-VerifyResult.cmake") -else() - # by default only print out output and error so that they can be compared by - # regex - message(STATUS "${output}") - message("${error}") endif() + +message(STATUS "${output}") +message("${error}") diff --git a/Tests/RunCMake/CPack/tests/DEPENDENCIES/DEB-stderr.txt b/Tests/RunCMake/CPack/tests/DEPENDENCIES/DEB-stderr.txt new file mode 100644 index 0000000..5df274a --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEPENDENCIES/DEB-stderr.txt @@ -0,0 +1 @@ +^CPackDeb: ((- Generating dependency list)|(Using only user-provided dependencies because dpkg-shlibdeps is not found\.))$ diff --git a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/RPM-stderr.txt b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/RPM-stderr.txt new file mode 100644 index 0000000..feb296c --- /dev/null +++ b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/RPM-stderr.txt @@ -0,0 +1 @@ +^(.*CPackRPM:Warning: SUGGESTS not supported in provided rpmbuild.*)?CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM/CPack/[^-]*-build/_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec$ -- cgit v0.12 From 0f15aee799a0af9fe1999d5c071483c9660ccf5b Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sat, 26 Nov 2016 19:53:59 +0100 Subject: Tests: CPack test move ExpectedFiles script Merge per generator ExpectedFiles scripts into one per test and move it to test dir. --- .../DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake | 5 ---- .../CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake | 9 ------- .../CPack/DEB/DEB_EXTRA-ExpectedFiles.cmake | 9 ------- .../DEB/DEB_GENERATE_SHLIBS-ExpectedFiles.cmake | 6 ----- ...EB_GENERATE_SHLIBS_LDCONFIG-ExpectedFiles.cmake | 6 ----- .../CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake | 14 ---------- .../CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake | 5 ---- .../CPack/DEB/LONG_FILENAMES-ExpectedFiles.cmake | 5 ---- .../RunCMake/CPack/DEB/MINIMAL-ExpectedFiles.cmake | 5 ---- .../DEB/PER_COMPONENT_FIELDS-ExpectedFiles.cmake | 9 ------- .../RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake | 5 ---- .../CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake | 9 ------- .../CPack/RPM/DEBUGINFO-ExpectedFiles.cmake | 14 ---------- .../CPack/RPM/DEPENDENCIES-ExpectedFiles.cmake | 13 ---------- .../CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake | 5 ---- .../CPack/RPM/INSTALL_SCRIPTS-ExpectedFiles.cmake | 7 ----- .../CPack/RPM/MAIN_COMPONENT-ExpectedFiles.cmake | 13 ---------- .../RunCMake/CPack/RPM/MINIMAL-ExpectedFiles.cmake | 5 ---- ...RTIALLY_RELOCATABLE_WARNING-ExpectedFiles.cmake | 5 ---- .../RPM/PER_COMPONENT_FIELDS-ExpectedFiles.cmake | 9 ------- .../CPack/RPM/RPM_DIST-ExpectedFiles.cmake | 5 ---- .../CPack/RPM/RPM_SUGGESTS-ExpectedFiles.cmake | 5 ---- .../CPack/RPM/SINGLE_DEBUGINFO-ExpectedFiles.cmake | 30 ---------------------- .../CPack/RPM/SOURCE_PACKAGE-ExpectedFiles.cmake | 5 ---- .../TGZ/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake | 3 --- .../CPack/TGZ/EMPTY_DIR-ExpectedFiles.cmake | 3 --- .../RunCMake/CPack/TGZ/MINIMAL-ExpectedFiles.cmake | 5 ---- .../CPack/TGZ/PACKAGE_CHECKSUM-ExpectedFiles.cmake | 9 ------- Tests/RunCMake/CPack/VerifyResult.cmake | 2 +- .../tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake | 14 ++++++++++ .../CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake | 19 ++++++++++++++ .../CPack/tests/DEBUGINFO/ExpectedFiles.cmake | 14 ++++++++++ .../CPack/tests/DEB_EXTRA/ExpectedFiles.cmake | 9 +++++++ .../tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake | 6 +++++ .../ExpectedFiles.cmake | 6 +++++ .../CPack/tests/DEPENDENCIES/ExpectedFiles.cmake | 28 ++++++++++++++++++++ .../CPack/tests/EMPTY_DIR/ExpectedFiles.cmake | 14 ++++++++++ .../tests/INSTALL_SCRIPTS/ExpectedFiles.cmake | 7 +++++ .../CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake | 5 ++++ .../CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake | 13 ++++++++++ .../CPack/tests/MINIMAL/ExpectedFiles.cmake | 14 ++++++++++ .../tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake | 9 +++++++ .../ExpectedFiles.cmake | 5 ++++ .../tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake | 19 ++++++++++++++ .../CPack/tests/RPM_DIST/ExpectedFiles.cmake | 5 ++++ .../CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake | 5 ++++ .../tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake | 30 ++++++++++++++++++++++ .../CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake | 5 ++++ 48 files changed, 228 insertions(+), 224 deletions(-) delete mode 100644 Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/DEB_EXTRA-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/LONG_FILENAMES-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/MINIMAL-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/DEBUGINFO-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/DEPENDENCIES-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/MINIMAL-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/RPM_DIST-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/SOURCE_PACKAGE-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/TGZ/EMPTY_DIR-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/TGZ/MINIMAL-ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEPENDENCIES/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/MINIMAL/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake diff --git a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake deleted file mode 100644 index 62f2f9c..0000000 --- a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "components_empty_dir-test_0.1.1-1_*.deb") -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/empty/$") diff --git a/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake deleted file mode 100644 index 2acf45b..0000000 --- a/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake +++ /dev/null @@ -1,9 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "3") -set(EXPECTED_FILE_1 "custom_names-pkg_1_0.1.1-1_*.deb") -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_2 "second*.deb") -set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_3 "pkg_3_abc.deb") -set(EXPECTED_FILE_CONTENT_3 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/DEB/DEB_EXTRA-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/DEB_EXTRA-ExpectedFiles.cmake deleted file mode 100644 index 4531a34..0000000 --- a/Tests/RunCMake/CPack/DEB/DEB_EXTRA-ExpectedFiles.cmake +++ /dev/null @@ -1,9 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "3") -set(EXPECTED_FILE_1 "deb_extra-foo_0.1.1-1_*.deb") -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/foo/${whitespaces_}.*/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_2 "deb_extra-bar_0.1.1-1_*.deb") -set(EXPECTED_FILE_CONTENT_2 "^.*/usr/${whitespaces_}.*/usr/bar/${whitespaces_}.*/usr/bar/CMakeLists.txt$") -set(EXPECTED_FILE_3 "deb_extra-bas_0.1.1-1_*.deb") -set(EXPECTED_FILE_CONTENT_3 "^.*/usr/${whitespaces_}.*/usr/bas/${whitespaces_}.*/usr/bas/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-ExpectedFiles.cmake deleted file mode 100644 index 32a2327..0000000 --- a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-ExpectedFiles.cmake +++ /dev/null @@ -1,6 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "deb_generate_shlibs_0.1.1-1_*.deb") -# dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-ExpectedFiles.cmake deleted file mode 100644 index 4966818..0000000 --- a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-ExpectedFiles.cmake +++ /dev/null @@ -1,6 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "deb_generate_shlibs_ldconfig_0.1.1-1_*.deb") -# dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/lib${whitespaces_}.*/usr/lib/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake deleted file mode 100644 index a6f08fe..0000000 --- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake +++ /dev/null @@ -1,14 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "5") -set(EXPECTED_FILE_1 "dependencies-0.1.1-*-applications.deb") -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/test_prog$") -set(EXPECTED_FILE_2 "dependencies-0.1.1-*-applications_auto.deb") -set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo_auto${whitespaces_}.*/usr/foo_auto/test_prog$") -set(EXPECTED_FILE_3 "dependencies-0.1.1-*-headers.deb") -set(EXPECTED_FILE_CONTENT_3 "^.*/usr/bar${whitespaces_}.*/usr/bar/CMakeLists.txt$") -set(EXPECTED_FILE_4 "dependencies-0.1.1-*-libs.deb") -# 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_5 "dependencies-0.1.1-*-libs_auto.deb") -set(EXPECTED_FILE_CONTENT_5 "^.*/usr/bas_auto${whitespaces_}.*/usr/bas_auto/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake deleted file mode 100644 index 6dc5906..0000000 --- a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "empty_dir_0.1.1-1_*.deb") -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/empty/$") diff --git a/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-ExpectedFiles.cmake deleted file mode 100644 index dd72cf7..0000000 --- a/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "long_filenames_0.1.1-1_*.deb") -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$") diff --git a/Tests/RunCMake/CPack/DEB/MINIMAL-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/MINIMAL-ExpectedFiles.cmake deleted file mode 100644 index 648c866..0000000 --- a/Tests/RunCMake/CPack/DEB/MINIMAL-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "minimal_0.1.1-1_*.deb") -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/foo/${whitespaces_}.*/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-ExpectedFiles.cmake deleted file mode 100644 index 11586a8..0000000 --- a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-ExpectedFiles.cmake +++ /dev/null @@ -1,9 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "3") -set(EXPECTED_FILE_1 "per_component_fields-pkg_1_0.1.1-1_*.deb") -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_2 "second_0.1.1-1_*.deb") -set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_3 "per_component_fields-pkg_3_0.1.1-1_*.deb") -set(EXPECTED_FILE_CONTENT_3 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake deleted file mode 100644 index d396276..0000000 --- a/Tests/RunCMake/CPack/RPM/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "components_empty_dir*.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/usr/empty$") diff --git a/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake deleted file mode 100644 index 780e57e..0000000 --- a/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake +++ /dev/null @@ -1,9 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "3") -set(EXPECTED_FILE_1 "custom_names-pkg_1*.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_2 "second*.rpm") -set(EXPECTED_FILE_CONTENT_2 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_3 "pkg_3_abc.rpm") -set(EXPECTED_FILE_CONTENT_3 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/RPM/DEBUGINFO-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/DEBUGINFO-ExpectedFiles.cmake deleted file mode 100644 index a583e32..0000000 --- a/Tests/RunCMake/CPack/RPM/DEBUGINFO-ExpectedFiles.cmake +++ /dev/null @@ -1,14 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "5") -set(EXPECTED_FILE_1 "debuginfo-applications-0*.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/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_3 "debuginfo*-libs.rpm") -set(EXPECTED_FILE_CONTENT_3 "^/usr/bas${whitespaces_}/usr/bas/libtest_lib.so$") - -set(EXPECTED_FILE_4 "debuginfo-applications-debuginfo*.rpm") -set(EXPECTED_FILE_CONTENT_4 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*") -set(EXPECTED_FILE_5 "debuginfo-libs-debuginfo*.rpm") -set(EXPECTED_FILE_CONTENT_5 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/test_lib.cpp.*") diff --git a/Tests/RunCMake/CPack/RPM/DEPENDENCIES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/DEPENDENCIES-ExpectedFiles.cmake deleted file mode 100644 index cf85dab..0000000 --- a/Tests/RunCMake/CPack/RPM/DEPENDENCIES-ExpectedFiles.cmake +++ /dev/null @@ -1,13 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "5") -set(EXPECTED_FILE_1 "dependencies*-applications.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/test_prog$") -set(EXPECTED_FILE_2 "dependencies*-applications_auto.rpm") -set(EXPECTED_FILE_CONTENT_2 "^/usr/foo_auto${whitespaces_}/usr/foo_auto/test_prog$") -set(EXPECTED_FILE_3 "dependencies*-headers.rpm") -set(EXPECTED_FILE_CONTENT_3 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") -set(EXPECTED_FILE_4 "dependencies*-libs.rpm") -set(EXPECTED_FILE_CONTENT_4 "^/usr/bas${whitespaces_}/usr/bas/libtest_lib.so$") -set(EXPECTED_FILE_5 "dependencies*-libs_auto.rpm") -set(EXPECTED_FILE_CONTENT_5 "^/usr/bas_auto${whitespaces_}/usr/bas_auto/libtest_lib.so$") diff --git a/Tests/RunCMake/CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake deleted file mode 100644 index 0c2977f..0000000 --- a/Tests/RunCMake/CPack/RPM/EMPTY_DIR-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "empty_dir*.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/usr/empty$") diff --git a/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-ExpectedFiles.cmake deleted file mode 100644 index 033a45d..0000000 --- a/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-ExpectedFiles.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "2") -set(EXPECTED_FILE_1 "install_scripts*-foo.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_2 "install_scripts*-bar.rpm") -set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-ExpectedFiles.cmake deleted file mode 100644 index 69603dd..0000000 --- a/Tests/RunCMake/CPack/RPM/MAIN_COMPONENT-ExpectedFiles.cmake +++ /dev/null @@ -1,13 +0,0 @@ -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_2 "main_component*-headers.rpm") - set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") - set(EXPECTED_FILE_3 "main_component*-libs.rpm") - set(EXPECTED_FILE_CONTENT_3 "^/usr/bas${whitespaces_}/usr/bas/CMakeLists.txt$") -endif() diff --git a/Tests/RunCMake/CPack/RPM/MINIMAL-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/MINIMAL-ExpectedFiles.cmake deleted file mode 100644 index 800b78e..0000000 --- a/Tests/RunCMake/CPack/RPM/MINIMAL-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "minimal*.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-ExpectedFiles.cmake deleted file mode 100644 index ddaa9db..0000000 --- a/Tests/RunCMake/CPack/RPM/PARTIALLY_RELOCATABLE_WARNING-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "partially_relocatable_warning-0.1.1-*.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/not_relocatable${whitespaces_}/not_relocatable/CMakeLists.txt${whitespaces_}/opt$") diff --git a/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-ExpectedFiles.cmake deleted file mode 100644 index b02ab8d..0000000 --- a/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-ExpectedFiles.cmake +++ /dev/null @@ -1,9 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "3") -set(EXPECTED_FILE_1 "per_component_fields*-pkg_1.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_2 "per_component_fields*-pkg_2.rpm") -set(EXPECTED_FILE_CONTENT_2 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_3 "per_component_fields*-pkg_3.rpm") -set(EXPECTED_FILE_CONTENT_3 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/RPM/RPM_DIST-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/RPM_DIST-ExpectedFiles.cmake deleted file mode 100644 index 3b5a347..0000000 --- a/Tests/RunCMake/CPack/RPM/RPM_DIST-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "rpm_dist*.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-ExpectedFiles.cmake deleted file mode 100644 index 02ebb44..0000000 --- a/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "rpm_suggests*.rpm") -set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-ExpectedFiles.cmake deleted file mode 100644 index dc49343..0000000 --- a/Tests/RunCMake/CPack/RPM/SINGLE_DEBUGINFO-ExpectedFiles.cmake +++ /dev/null @@ -1,30 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "0") - -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_2 "single_debuginfo*-headers.rpm") - set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/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_4 "single_debuginfo-debuginfo*.rpm") - 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_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_2 "single_debuginfo-debuginfo*.rpm") - set(EXPECTED_FILE_CONTENT_2 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*") -endif() diff --git a/Tests/RunCMake/CPack/RPM/SOURCE_PACKAGE-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/SOURCE_PACKAGE-ExpectedFiles.cmake deleted file mode 100644 index d6811eb..0000000 --- a/Tests/RunCMake/CPack/RPM/SOURCE_PACKAGE-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "source_package*.src.rpm") -set(EXPECTED_FILE_CONTENT_1 "^source_package-0.1.1.tar.gz${whitespaces_}source_package.spec$") diff --git a/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake deleted file mode 100644 index 26e2ab0..0000000 --- a/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "components_empty_dir*.tar.gz") -set(EXPECTED_FILE_CONTENT_1 "^[^\n]*empty/$") diff --git a/Tests/RunCMake/CPack/TGZ/EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/TGZ/EMPTY_DIR-ExpectedFiles.cmake deleted file mode 100644 index a75514a..0000000 --- a/Tests/RunCMake/CPack/TGZ/EMPTY_DIR-ExpectedFiles.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "empty_dir*.tar.gz") -set(EXPECTED_FILE_CONTENT_1 "^[^\n]*empty_dir-0.1.1-[^\n]*/empty/$") diff --git a/Tests/RunCMake/CPack/TGZ/MINIMAL-ExpectedFiles.cmake b/Tests/RunCMake/CPack/TGZ/MINIMAL-ExpectedFiles.cmake deleted file mode 100644 index 5c31f27..0000000 --- a/Tests/RunCMake/CPack/TGZ/MINIMAL-ExpectedFiles.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "minimal*.tar.gz") -set(EXPECTED_FILE_CONTENT_1 "^[^\n]*minimal-0.1.1-[^\n]*/foo/\n[^\n]*minimal-0.1.1-[^\n]*/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-ExpectedFiles.cmake b/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-ExpectedFiles.cmake deleted file mode 100644 index 205dcd8..0000000 --- a/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-ExpectedFiles.cmake +++ /dev/null @@ -1,9 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "0") - -if (NOT ${RunCMake_SUBTEST_SUFFIX} MATCHES "invalid") - set(EXPECTED_FILES_COUNT "1") - set(EXPECTED_FILE_1 "package_checksum*.tar.gz") - set(EXPECTED_FILE_CONTENT_1 "^[^\n]*package_checksum*-[^\n]*/foo/\n[^\n]*package_checksum-[^\n]*/foo/CMakeLists.txt$") -endif() diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake index 539cef6..803b4bc 100644 --- a/Tests/RunCMake/CPack/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/VerifyResult.cmake @@ -11,7 +11,7 @@ set(output_error_message "\nCPack output: '${output}'\nCPack error: '${error}';\nCPack result: '${PACKAGING_RESULT}';\nconfig file: '${config_file_content}'") # check that expected generated files exist and contain expected content -include("${src_dir}/${GENERATOR_TYPE}/${RunCMake_TEST_FILE_PREFIX}-ExpectedFiles.cmake") +include("${src_dir}/tests/${RunCMake_TEST_FILE_PREFIX}/ExpectedFiles.cmake") if(NOT EXPECTED_FILES_COUNT EQUAL 0) foreach(file_no_ RANGE 1 ${EXPECTED_FILES_COUNT}) diff --git a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake new file mode 100644 index 0000000..f42d8b1 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake @@ -0,0 +1,14 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") + +if(GENERATOR_TYPE STREQUAL "DEB") + set(EXPECTED_FILE_1 "components_empty_dir-test_0.1.1-1_*.deb") + set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/empty/$") +elseif(GENERATOR_TYPE STREQUAL "RPM") + set(EXPECTED_FILE_1 "components_empty_dir*.rpm") + set(EXPECTED_FILE_CONTENT_1 "^/usr/empty$") +elseif(GENERATOR_TYPE STREQUAL "TGZ") + set(EXPECTED_FILE_1 "components_empty_dir*.tar.gz") + 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 new file mode 100644 index 0000000..c0389ba --- /dev/null +++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake @@ -0,0 +1,19 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "3") + +if(GENERATOR_TYPE STREQUAL "DEB") + set(EXPECTED_FILE_1 "custom_names-pkg_1_0.1.1-1_*.deb") + set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") + set(EXPECTED_FILE_2 "second*.deb") + set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") + set(EXPECTED_FILE_3 "pkg_3_abc.deb") + set(EXPECTED_FILE_CONTENT_3 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") +elseif(GENERATOR_TYPE STREQUAL "RPM") + set(EXPECTED_FILE_1 "custom_names-pkg_1*.rpm") + set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") + set(EXPECTED_FILE_2 "second*.rpm") + set(EXPECTED_FILE_CONTENT_2 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") + set(EXPECTED_FILE_3 "pkg_3_abc.rpm") + set(EXPECTED_FILE_CONTENT_3 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") +endif() diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake new file mode 100644 index 0000000..a583e32 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake @@ -0,0 +1,14 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "5") +set(EXPECTED_FILE_1 "debuginfo-applications-0*.rpm") +set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/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_3 "debuginfo*-libs.rpm") +set(EXPECTED_FILE_CONTENT_3 "^/usr/bas${whitespaces_}/usr/bas/libtest_lib.so$") + +set(EXPECTED_FILE_4 "debuginfo-applications-debuginfo*.rpm") +set(EXPECTED_FILE_CONTENT_4 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*") +set(EXPECTED_FILE_5 "debuginfo-libs-debuginfo*.rpm") +set(EXPECTED_FILE_CONTENT_5 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/test_lib.cpp.*") diff --git a/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake new file mode 100644 index 0000000..4531a34 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake @@ -0,0 +1,9 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "3") +set(EXPECTED_FILE_1 "deb_extra-foo_0.1.1-1_*.deb") +set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/foo/${whitespaces_}.*/usr/foo/CMakeLists.txt$") +set(EXPECTED_FILE_2 "deb_extra-bar_0.1.1-1_*.deb") +set(EXPECTED_FILE_CONTENT_2 "^.*/usr/${whitespaces_}.*/usr/bar/${whitespaces_}.*/usr/bar/CMakeLists.txt$") +set(EXPECTED_FILE_3 "deb_extra-bas_0.1.1-1_*.deb") +set(EXPECTED_FILE_CONTENT_3 "^.*/usr/${whitespaces_}.*/usr/bas/${whitespaces_}.*/usr/bas/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake new file mode 100644 index 0000000..32a2327 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake @@ -0,0 +1,6 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "deb_generate_shlibs_0.1.1-1_*.deb") +# dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it +set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake new file mode 100644 index 0000000..4966818 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake @@ -0,0 +1,6 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "deb_generate_shlibs_ldconfig_0.1.1-1_*.deb") +# dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it +set(EXPECTED_FILE_CONTENT_1 "^.*/usr/lib${whitespaces_}.*/usr/lib/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/tests/DEPENDENCIES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEPENDENCIES/ExpectedFiles.cmake new file mode 100644 index 0000000..8459dd3 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEPENDENCIES/ExpectedFiles.cmake @@ -0,0 +1,28 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "5") + +if(GENERATOR_TYPE STREQUAL "DEB") + set(EXPECTED_FILE_1 "dependencies-0.1.1-*-applications.deb") + set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/test_prog$") + set(EXPECTED_FILE_2 "dependencies-0.1.1-*-applications_auto.deb") + set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo_auto${whitespaces_}.*/usr/foo_auto/test_prog$") + set(EXPECTED_FILE_3 "dependencies-0.1.1-*-headers.deb") + set(EXPECTED_FILE_CONTENT_3 "^.*/usr/bar${whitespaces_}.*/usr/bar/CMakeLists.txt$") + set(EXPECTED_FILE_4 "dependencies-0.1.1-*-libs.deb") + # 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_5 "dependencies-0.1.1-*-libs_auto.deb") + set(EXPECTED_FILE_CONTENT_5 "^.*/usr/bas_auto${whitespaces_}.*/usr/bas_auto/libtest_lib\\..*$") +elseif(GENERATOR_TYPE STREQUAL "RPM") + set(EXPECTED_FILE_1 "dependencies*-applications.rpm") + set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/test_prog$") + set(EXPECTED_FILE_2 "dependencies*-applications_auto.rpm") + set(EXPECTED_FILE_CONTENT_2 "^/usr/foo_auto${whitespaces_}/usr/foo_auto/test_prog$") + set(EXPECTED_FILE_3 "dependencies*-headers.rpm") + set(EXPECTED_FILE_CONTENT_3 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") + set(EXPECTED_FILE_4 "dependencies*-libs.rpm") + set(EXPECTED_FILE_CONTENT_4 "^/usr/bas${whitespaces_}/usr/bas/libtest_lib.so$") + set(EXPECTED_FILE_5 "dependencies*-libs_auto.rpm") + 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 new file mode 100644 index 0000000..5924f1f --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake @@ -0,0 +1,14 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") + +if(GENERATOR_TYPE STREQUAL "DEB") + set(EXPECTED_FILE_1 "empty_dir_0.1.1-1_*.deb") + set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/empty/$") +elseif(GENERATOR_TYPE STREQUAL "RPM") + set(EXPECTED_FILE_1 "empty_dir*.rpm") + set(EXPECTED_FILE_CONTENT_1 "^/usr/empty$") +elseif(GENERATOR_TYPE STREQUAL "TGZ") + set(EXPECTED_FILE_1 "empty_dir*.tar.gz") + set(EXPECTED_FILE_CONTENT_1 "^[^\n]*empty_dir-0.1.1-[^\n]*/empty/$") +endif() diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake new file mode 100644 index 0000000..033a45d --- /dev/null +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake @@ -0,0 +1,7 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "2") +set(EXPECTED_FILE_1 "install_scripts*-foo.rpm") +set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") +set(EXPECTED_FILE_2 "install_scripts*-bar.rpm") +set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake new file mode 100644 index 0000000..dd72cf7 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake @@ -0,0 +1,5 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "long_filenames_0.1.1-1_*.deb") +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$") diff --git a/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake new file mode 100644 index 0000000..69603dd --- /dev/null +++ b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake @@ -0,0 +1,13 @@ +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_2 "main_component*-headers.rpm") + set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") + set(EXPECTED_FILE_3 "main_component*-libs.rpm") + set(EXPECTED_FILE_CONTENT_3 "^/usr/bas${whitespaces_}/usr/bas/CMakeLists.txt$") +endif() diff --git a/Tests/RunCMake/CPack/tests/MINIMAL/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/MINIMAL/ExpectedFiles.cmake new file mode 100644 index 0000000..546b891 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/MINIMAL/ExpectedFiles.cmake @@ -0,0 +1,14 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") + +if(GENERATOR_TYPE STREQUAL "DEB") + set(EXPECTED_FILE_1 "minimal_0.1.1-1_*.deb") + set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/foo/${whitespaces_}.*/usr/foo/CMakeLists.txt$") +elseif(GENERATOR_TYPE STREQUAL "RPM") + set(EXPECTED_FILE_1 "minimal*.rpm") + set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") +elseif(GENERATOR_TYPE STREQUAL "TGZ") + set(EXPECTED_FILE_1 "minimal*.tar.gz") + set(EXPECTED_FILE_CONTENT_1 "^[^\n]*minimal-0.1.1-[^\n]*/foo/\n[^\n]*minimal-0.1.1-[^\n]*/foo/CMakeLists.txt$") +endif() diff --git a/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake new file mode 100644 index 0000000..205dcd8 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake @@ -0,0 +1,9 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "0") + +if (NOT ${RunCMake_SUBTEST_SUFFIX} MATCHES "invalid") + set(EXPECTED_FILES_COUNT "1") + set(EXPECTED_FILE_1 "package_checksum*.tar.gz") + set(EXPECTED_FILE_CONTENT_1 "^[^\n]*package_checksum*-[^\n]*/foo/\n[^\n]*package_checksum-[^\n]*/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 new file mode 100644 index 0000000..ddaa9db --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/ExpectedFiles.cmake @@ -0,0 +1,5 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "partially_relocatable_warning-0.1.1-*.rpm") +set(EXPECTED_FILE_CONTENT_1 "^/not_relocatable${whitespaces_}/not_relocatable/CMakeLists.txt${whitespaces_}/opt$") diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake new file mode 100644 index 0000000..8ff725c --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake @@ -0,0 +1,19 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "3") + +if(GENERATOR_TYPE STREQUAL "DEB") + set(EXPECTED_FILE_1 "per_component_fields-pkg_1_0.1.1-1_*.deb") + set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") + set(EXPECTED_FILE_2 "second_0.1.1-1_*.deb") + set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") + set(EXPECTED_FILE_3 "per_component_fields-pkg_3_0.1.1-1_*.deb") + set(EXPECTED_FILE_CONTENT_3 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") +elseif(GENERATOR_TYPE STREQUAL "RPM") + set(EXPECTED_FILE_1 "per_component_fields*-pkg_1.rpm") + set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") + set(EXPECTED_FILE_2 "per_component_fields*-pkg_2.rpm") + set(EXPECTED_FILE_CONTENT_2 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") + set(EXPECTED_FILE_3 "per_component_fields*-pkg_3.rpm") + set(EXPECTED_FILE_CONTENT_3 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") +endif() diff --git a/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake new file mode 100644 index 0000000..3b5a347 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake @@ -0,0 +1,5 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "rpm_dist*.rpm") +set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake new file mode 100644 index 0000000..02ebb44 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake @@ -0,0 +1,5 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "rpm_suggests*.rpm") +set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake new file mode 100644 index 0000000..dc49343 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake @@ -0,0 +1,30 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "0") + +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_2 "single_debuginfo*-headers.rpm") + set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/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_4 "single_debuginfo-debuginfo*.rpm") + 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_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_2 "single_debuginfo-debuginfo*.rpm") + set(EXPECTED_FILE_CONTENT_2 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*") +endif() diff --git a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake new file mode 100644 index 0000000..d6811eb --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake @@ -0,0 +1,5 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "source_package*.src.rpm") +set(EXPECTED_FILE_CONTENT_1 "^source_package-0.1.1.tar.gz${whitespaces_}source_package.spec$") -- cgit v0.12 From 6d51bea4e6ff058383e63c215ec5fb7fcab9870c Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sat, 26 Nov 2016 20:08:25 +0100 Subject: Tests: CPack test merge generator specifics Merge test generator specifics into test itself. --- Tests/RunCMake/CPack/CMakeLists.txt | 5 --- .../CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake | 3 -- .../CPack/DEB/CUSTOM_NAMES-specifics.cmake | 6 --- .../CPack/DEB/DEPENDENCIES-specifics.cmake | 23 ---------- Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake | 2 - .../CPack/DEB/LONG_FILENAMES-specifics.cmake | 3 -- Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake | 2 - .../CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake | 7 ---- .../CPack/RPM/CUSTOM_NAMES-specifics.cmake | 5 --- .../CPack/RPM/DEPENDENCIES-specifics.cmake | 22 ---------- .../CPack/RPM/INSTALL_SCRIPTS-specifics.cmake | 19 --------- .../CPack/RPM/PER_COMPONENT_FIELDS-specifics.cmake | 5 --- .../CPack/TGZ/COMPONENTS_EMPTY_DIR-specifics.cmake | 1 - .../CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake | 10 +++++ Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake | 15 ++++++- Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake | 49 ++++++++++++++++++++++ Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake | 5 +++ .../CPack/tests/INSTALL_SCRIPTS/test.cmake | 22 ++++++++++ .../RunCMake/CPack/tests/LONG_FILENAMES/test.cmake | 6 +++ Tests/RunCMake/CPack/tests/MINIMAL/test.cmake | 5 +++ .../CPack/tests/PER_COMPONENT_FIELDS/test.cmake | 16 +++++++ 21 files changed, 127 insertions(+), 104 deletions(-) delete mode 100644 Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/LONG_FILENAMES-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/DEPENDENCIES-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-specifics.cmake delete mode 100644 Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-specifics.cmake diff --git a/Tests/RunCMake/CPack/CMakeLists.txt b/Tests/RunCMake/CPack/CMakeLists.txt index c4d9d5d..e06fa1c 100644 --- a/Tests/RunCMake/CPack/CMakeLists.txt +++ b/Tests/RunCMake/CPack/CMakeLists.txt @@ -7,10 +7,5 @@ string(TOLOWER "${RunCMake_TEST_FILE_PREFIX}" CPACK_PACKAGE_NAME) include(tests/${RunCMake_TEST_FILE_PREFIX}/test.cmake) -# include test generator specifics -if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${GENERATOR_TYPE}/${RunCMake_TEST_FILE_PREFIX}-specifics.cmake") - include("${GENERATOR_TYPE}/${RunCMake_TEST_FILE_PREFIX}-specifics.cmake") -endif() - set(CPACK_GENERATOR "${GENERATOR_TYPE}") include(CPack) diff --git a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake deleted file mode 100644 index 4b4ac8d..0000000 --- a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") -set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") diff --git a/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake deleted file mode 100644 index c64f161..0000000 --- a/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake +++ /dev/null @@ -1,6 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") - -set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") -set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second") -set(CPACK_DEBIAN_PKG_3_FILE_NAME "pkg_3_abc.deb") diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake deleted file mode 100644 index 5f82cc6..0000000 --- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake +++ /dev/null @@ -1,23 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") -#intentionaly commented out to test old file naming -#set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - -# false by default -set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS FALSE) -# FIXME can not be tested as libraries first have to be part of a package in order -# to determine their dependencies and we can not be certain if there will be any -set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_SHLIBDEPS TRUE) - -foreach(dependency_type_ DEPENDS CONFLICTS PREDEPENDS ENHANCES BREAKS REPLACES RECOMMENDS SUGGESTS) - string(TOLOWER "${dependency_type_}" lower_dependency_type_) - - set(CPACK_DEBIAN_PACKAGE_${dependency_type_} "${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b") - set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b") - set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b") - set(CPACK_DEBIAN_HEADERS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-headers") -endforeach() - -set(CPACK_DEBIAN_PACKAGE_PROVIDES "provided-default, provided-default-b") -set(CPACK_DEBIAN_LIBS_PACKAGE_PROVIDES "provided-lib") -set(CPACK_DEBIAN_LIBS_AUTO_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b") diff --git a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake deleted file mode 100644 index 4e9a2e7..0000000 --- a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") diff --git a/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-specifics.cmake b/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-specifics.cmake deleted file mode 100644 index 39a6be4..0000000 --- a/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-specifics.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") -set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar") diff --git a/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake b/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake deleted file mode 100644 index 4e9a2e7..0000000 --- a/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") diff --git a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake deleted file mode 100644 index 25bd2e7..0000000 --- a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") -set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - -set(CPACK_DEBIAN_PACKAGE_SECTION "default") -set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second") -set(CPACK_DEBIAN_PKG_2_PACKAGE_SECTION "second_group") diff --git a/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake deleted file mode 100644 index 575aa01..0000000 --- a/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(CPACK_RPM_COMPONENT_INSTALL "ON") - -set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") -set(CPACK_RPM_PKG_2_PACKAGE_NAME "second") -set(CPACK_RPM_PKG_3_FILE_NAME "pkg_3_abc.rpm") diff --git a/Tests/RunCMake/CPack/RPM/DEPENDENCIES-specifics.cmake b/Tests/RunCMake/CPack/RPM/DEPENDENCIES-specifics.cmake deleted file mode 100644 index 8b7fb1e..0000000 --- a/Tests/RunCMake/CPack/RPM/DEPENDENCIES-specifics.cmake +++ /dev/null @@ -1,22 +0,0 @@ -set(CPACK_RPM_COMPONENT_INSTALL "ON") - -# FIXME auto autoprov is not tested at the moment as Ubuntu 15.04 rpmbuild -# does not use them correctly: https://bugs.launchpad.net/rpm/+bug/1475755 -set(CPACK_RPM_PACKAGE_AUTOREQ "no") -set(CPACK_RPM_PACKAGE_AUTOPROV "no") -set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_AUTOREQPROV "yes") -set(CPACK_RPM_LIBS_AUTO_PACKAGE_AUTOREQPROV "yes") - -set(CPACK_RPM_PACKAGE_REQUIRES "depend-default, depend-default-b") -set(CPACK_RPM_APPLICATIONS_PACKAGE_REQUIRES "depend-application, depend-application-b") -set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_REQUIRES "depend-application, depend-application-b") -set(CPACK_RPM_HEADERS_PACKAGE_REQUIRES "depend-headers") - -set(CPACK_RPM_PACKAGE_CONFLICTS "conflict-default, conflict-default-b") -set(CPACK_RPM_APPLICATIONS_PACKAGE_CONFLICTS "conflict-application, conflict-application-b") -set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_CONFLICTS "conflict-application, conflict-application-b") -set(CPACK_RPM_HEADERS_PACKAGE_CONFLICTS "conflict-headers") - -set(CPACK_RPM_PACKAGE_PROVIDES "provided-default, provided-default-b") -set(CPACK_RPM_LIBS_PACKAGE_PROVIDES "provided-lib") -set(CPACK_RPM_LIBS_AUTO_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b") diff --git a/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-specifics.cmake b/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-specifics.cmake deleted file mode 100644 index 4eb53c3..0000000 --- a/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-specifics.cmake +++ /dev/null @@ -1,19 +0,0 @@ -set(CPACK_RPM_COMPONENT_INSTALL "ON") - -set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE - "${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh") -set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE - "${CMAKE_CURRENT_BINARY_DIR}/post_install.sh") -set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE - "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh") -set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE - "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh") - -set(CPACK_RPM_foo_PRE_INSTALL_SCRIPT_FILE - "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh") -set(CPACK_RPM_foo_POST_INSTALL_SCRIPT_FILE - "${CMAKE_CURRENT_BINARY_DIR}/post_install_foo.sh") -set(CPACK_RPM_foo_PRE_UNINSTALL_SCRIPT_FILE - "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh") -set(CPACK_RPM_foo_POST_UNINSTALL_SCRIPT_FILE - "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh") diff --git a/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-specifics.cmake b/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-specifics.cmake deleted file mode 100644 index 524ef0c..0000000 --- a/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-specifics.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(CPACK_RPM_COMPONENT_INSTALL "ON") - -set(CPACK_RPM_PACKAGE_GROUP "default") -set(CPACK_RPM_PKG_2_PACKAGE_NAME "second") -set(CPACK_RPM_PKG_2_PACKAGE_GROUP "second_group") diff --git a/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-specifics.cmake deleted file mode 100644 index 81a5035..0000000 --- a/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-specifics.cmake +++ /dev/null @@ -1 +0,0 @@ -set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") diff --git a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake index 9cd91af..1ad01c1 100644 --- a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake +++ b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake @@ -1,3 +1,13 @@ +if(GENERATOR_TYPE STREQUAL "DEB") + set(CPACK_PACKAGE_CONTACT "someone") + set(CPACK_DEB_COMPONENT_INSTALL "ON") + set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") +elseif(GENERATOR_TYPE STREQUAL "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") +elseif(GENERATOR_TYPE STREQUAL "TGZ") + set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") +endif() + set(CPACK_COMPONENTS_ALL test) install(DIRECTORY DESTINATION empty COMPONENT test) diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake index 115864f..3185e9f 100644 --- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake +++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake @@ -1,4 +1,17 @@ -set(CPACK_RPM_COMPONENT_INSTALL "ON") +if(GENERATOR_TYPE STREQUAL "DEB") + set(CPACK_PACKAGE_CONTACT "someone") + set(CPACK_DEB_COMPONENT_INSTALL "ON") + + set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") + set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second") + set(CPACK_DEBIAN_PKG_3_FILE_NAME "pkg_3_abc.deb") +elseif(GENERATOR_TYPE STREQUAL "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") + + set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") + set(CPACK_RPM_PKG_2_PACKAGE_NAME "second") + set(CPACK_RPM_PKG_3_FILE_NAME "pkg_3_abc.rpm") +endif() install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_2) diff --git a/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake b/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake index 4499a7a..cabbba8 100644 --- a/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake +++ b/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake @@ -1,3 +1,52 @@ +if(GENERATOR_TYPE STREQUAL "DEB") + set(CPACK_PACKAGE_CONTACT "someone") + set(CPACK_DEB_COMPONENT_INSTALL "ON") + #intentionaly commented out to test old file naming + #set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") + + # false by default + set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS FALSE) + # FIXME can not be tested as libraries first have to be part of a package in order + # to determine their dependencies and we can not be certain if there will be any + set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_SHLIBDEPS TRUE) + + foreach(dependency_type_ DEPENDS CONFLICTS PREDEPENDS ENHANCES BREAKS REPLACES RECOMMENDS SUGGESTS) + string(TOLOWER "${dependency_type_}" lower_dependency_type_) + + set(CPACK_DEBIAN_PACKAGE_${dependency_type_} "${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b") + set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b") + set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b") + set(CPACK_DEBIAN_HEADERS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-headers") + endforeach() + + set(CPACK_DEBIAN_PACKAGE_PROVIDES "provided-default, provided-default-b") + set(CPACK_DEBIAN_LIBS_PACKAGE_PROVIDES "provided-lib") + set(CPACK_DEBIAN_LIBS_AUTO_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b") +elseif(GENERATOR_TYPE STREQUAL "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") + + # FIXME auto autoprov is not tested at the moment as Ubuntu 15.04 rpmbuild + # does not use them correctly: https://bugs.launchpad.net/rpm/+bug/1475755 + set(CPACK_RPM_PACKAGE_AUTOREQ "no") + set(CPACK_RPM_PACKAGE_AUTOPROV "no") + set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_AUTOREQPROV "yes") + set(CPACK_RPM_LIBS_AUTO_PACKAGE_AUTOREQPROV "yes") + + set(CPACK_RPM_PACKAGE_REQUIRES "depend-default, depend-default-b") + set(CPACK_RPM_APPLICATIONS_PACKAGE_REQUIRES "depend-application, depend-application-b") + set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_REQUIRES "depend-application, depend-application-b") + set(CPACK_RPM_HEADERS_PACKAGE_REQUIRES "depend-headers") + + set(CPACK_RPM_PACKAGE_CONFLICTS "conflict-default, conflict-default-b") + set(CPACK_RPM_APPLICATIONS_PACKAGE_CONFLICTS "conflict-application, conflict-application-b") + set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_CONFLICTS "conflict-application, conflict-application-b") + set(CPACK_RPM_HEADERS_PACKAGE_CONFLICTS "conflict-headers") + + set(CPACK_RPM_PACKAGE_PROVIDES "provided-default, provided-default-b") + set(CPACK_RPM_LIBS_PACKAGE_PROVIDES "provided-lib") + set(CPACK_RPM_LIBS_AUTO_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b") +endif() + set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" diff --git a/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake b/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake index 7bec17d..e435ced 100644 --- a/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake +++ b/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake @@ -1,2 +1,7 @@ +if(GENERATOR_TYPE STREQUAL "DEB") + set(CPACK_PACKAGE_CONTACT "someone") + set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") +endif() + install(DIRECTORY DESTINATION empty COMPONENT test) diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake index 9b3e856..e16f8e1 100644 --- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake @@ -1,3 +1,25 @@ +if(GENERATOR_TYPE STREQUAL "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") + + set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh") + set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/post_install.sh") + set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh") + set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh") + + set(CPACK_RPM_foo_PRE_INSTALL_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh") + set(CPACK_RPM_foo_POST_INSTALL_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/post_install_foo.sh") + set(CPACK_RPM_foo_PRE_UNINSTALL_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh") + set(CPACK_RPM_foo_POST_UNINSTALL_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh") +endif() + set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) # default diff --git a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake index 3370a50..f6656c6 100644 --- a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake +++ b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake @@ -1,3 +1,9 @@ +if(GENERATOR_TYPE STREQUAL "DEB") + set(CPACK_PACKAGE_CONTACT "someone") + set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") + set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar") +endif() + set(LONG_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/llllllllll_oooooooooo_nnnnnnnnnn_gggggggggg_ffffffffff_iiiiiiiiii_llllllllll_eeeeeeeeee_nnnnnnnnnn_aaaaaaaaaa_mmmmmmmmmm_eeeeeeeeee.txt") diff --git a/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake b/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake index 83ed0f2..2182f46 100644 --- a/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake +++ b/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake @@ -1 +1,6 @@ +if(GENERATOR_TYPE STREQUAL "DEB") + set(CPACK_PACKAGE_CONTACT "someone") + set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") +endif() + install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake index 703c1b7..b042092 100644 --- a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake +++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake @@ -1,3 +1,19 @@ +if(GENERATOR_TYPE STREQUAL "DEB") + set(CPACK_PACKAGE_CONTACT "someone") + set(CPACK_DEB_COMPONENT_INSTALL "ON") + set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") + + set(CPACK_DEBIAN_PACKAGE_SECTION "default") + set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second") + set(CPACK_DEBIAN_PKG_2_PACKAGE_SECTION "second_group") +elseif(GENERATOR_TYPE STREQUAL "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") + + set(CPACK_RPM_PACKAGE_GROUP "default") + set(CPACK_RPM_PKG_2_PACKAGE_NAME "second") + set(CPACK_RPM_PKG_2_PACKAGE_GROUP "second_group") +endif() + install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_2) install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_3) -- cgit v0.12 From 79443e1b8b604de00d269e73a977f449bc3fcef2 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sat, 26 Nov 2016 20:13:50 +0100 Subject: Tests: CPack test move per test prerequirements Move per test prerequirements into the belonging test. --- Tests/RunCMake/CPack/CPackTestHelpers.cmake | 4 ++-- Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-Prerequirements.cmake | 7 ------- .../CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-Prerequirements.cmake | 7 ------- Tests/RunCMake/CPack/DEB/LONG_FILENAMES-Prerequirements.cmake | 7 ------- .../CPack/tests/DEB_GENERATE_SHLIBS/DEB-Prerequirements.cmake | 7 +++++++ .../tests/DEB_GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake | 7 +++++++ .../RunCMake/CPack/tests/LONG_FILENAMES/DEB-Prerequirements.cmake | 7 +++++++ 7 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-Prerequirements.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-Prerequirements.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/LONG_FILENAMES-Prerequirements.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/DEB-Prerequirements.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake create mode 100644 Tests/RunCMake/CPack/tests/LONG_FILENAMES/DEB-Prerequirements.cmake diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake index 94be2f9..3d80cc6 100644 --- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake +++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake @@ -15,8 +15,8 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - if(EXISTS "${RunCMake_SOURCE_DIR}/${TEST_TYPE}/${TEST_NAME}-Prerequirements.cmake") - include("${RunCMake_SOURCE_DIR}/${TEST_TYPE}/${TEST_NAME}-Prerequirements.cmake") + if(EXISTS "${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-Prerequirements.cmake") + include("${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-Prerequirements.cmake") set(FOUND_PREREQUIREMENTS false) get_test_prerequirements("FOUND_PREREQUIREMENTS" "${config_file}") diff --git a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-Prerequirements.cmake b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-Prerequirements.cmake deleted file mode 100644 index b98065a..0000000 --- a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-Prerequirements.cmake +++ /dev/null @@ -1,7 +0,0 @@ -function(get_test_prerequirements found_var) - find_program(READELF_EXECUTABLE NAMES readelf) - - if(READELF_EXECUTABLE) - set(${found_var} true PARENT_SCOPE) - endif() -endfunction() diff --git a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-Prerequirements.cmake b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-Prerequirements.cmake deleted file mode 100644 index b98065a..0000000 --- a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-Prerequirements.cmake +++ /dev/null @@ -1,7 +0,0 @@ -function(get_test_prerequirements found_var) - find_program(READELF_EXECUTABLE NAMES readelf) - - if(READELF_EXECUTABLE) - set(${found_var} true PARENT_SCOPE) - endif() -endfunction() diff --git a/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-Prerequirements.cmake b/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-Prerequirements.cmake deleted file mode 100644 index 0c1d77e..0000000 --- a/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-Prerequirements.cmake +++ /dev/null @@ -1,7 +0,0 @@ -function(get_test_prerequirements found_var) - find_program(FAKEROOT_EXECUTABLE NAMES fakeroot) - - if(FAKEROOT_EXECUTABLE) - set(${found_var} true PARENT_SCOPE) - endif() -endfunction() diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/DEB-Prerequirements.cmake new file mode 100644 index 0000000..b98065a --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/DEB-Prerequirements.cmake @@ -0,0 +1,7 @@ +function(get_test_prerequirements found_var) + find_program(READELF_EXECUTABLE NAMES readelf) + + if(READELF_EXECUTABLE) + set(${found_var} true PARENT_SCOPE) + endif() +endfunction() diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake new file mode 100644 index 0000000..b98065a --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake @@ -0,0 +1,7 @@ +function(get_test_prerequirements found_var) + find_program(READELF_EXECUTABLE NAMES readelf) + + if(READELF_EXECUTABLE) + set(${found_var} true PARENT_SCOPE) + endif() +endfunction() diff --git a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/DEB-Prerequirements.cmake new file mode 100644 index 0000000..0c1d77e --- /dev/null +++ b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/DEB-Prerequirements.cmake @@ -0,0 +1,7 @@ +function(get_test_prerequirements found_var) + find_program(FAKEROOT_EXECUTABLE NAMES fakeroot) + + if(FAKEROOT_EXECUTABLE) + set(${found_var} true PARENT_SCOPE) + endif() +endfunction() -- cgit v0.12 From 8575affa4c72e1c0d07f964d2f28eb6ddbadb291 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sat, 26 Nov 2016 20:37:07 +0100 Subject: Tests: CPack test move and merge VerifyResult Merge VerifyResult of different generators pertest and move the file to its test dir. --- .../CPack/DEB/DEB_EXTRA-VerifyResult.cmake | 18 ----- .../DEB/DEB_GENERATE_SHLIBS-VerifyResult.cmake | 4 -- ...DEB_GENERATE_SHLIBS_LDCONFIG-VerifyResult.cmake | 8 --- .../CPack/DEB/DEPENDENCIES-VerifyResult.cmake | 34 --------- .../CPack/DEB/LONG_FILENAMES-VerifyResult.cmake | 26 ------- .../DEB/PER_COMPONENT_FIELDS-VerifyResult.cmake | 18 ----- .../CPack/RPM/DEPENDENCIES-VerifyResult.cmake | 45 ------------ .../CPack/RPM/INSTALL_SCRIPTS-VerifyResult.cmake | 29 -------- .../RPM/PER_COMPONENT_FIELDS-VerifyResult.cmake | 18 ----- .../RunCMake/CPack/RPM/RPM_DIST-VerifyResult.cmake | 11 --- .../CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake | 31 -------- .../CPack/RPM/SOURCE_PACKAGE-VerifyResult.cmake | 63 ----------------- .../CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake | 12 ---- Tests/RunCMake/CPack/VerifyResult.cmake | 4 +- .../CPack/tests/DEB_EXTRA/VerifyResult.cmake | 18 +++++ .../tests/DEB_GENERATE_SHLIBS/VerifyResult.cmake | 4 ++ .../VerifyResult.cmake | 8 +++ .../CPack/tests/DEPENDENCIES/VerifyResult.cmake | 82 ++++++++++++++++++++++ .../CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake | 29 ++++++++ .../CPack/tests/LONG_FILENAMES/VerifyResult.cmake | 26 +++++++ .../tests/PACKAGE_CHECKSUM/VerifyResult.cmake | 12 ++++ .../tests/PER_COMPONENT_FIELDS/VerifyResult.cmake | 26 +++++++ .../CPack/tests/RPM_DIST/VerifyResult.cmake | 11 +++ .../CPack/tests/RPM_SUGGESTS/VerifyResult.cmake | 31 ++++++++ .../CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake | 63 +++++++++++++++++ 25 files changed, 312 insertions(+), 319 deletions(-) delete mode 100644 Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/LONG_FILENAMES-VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/DEPENDENCIES-VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/RPM_DIST-VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/RPM/SOURCE_PACKAGE-VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEB_EXTRA/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/LONG_FILENAMES/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/RPM_DIST/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/RPM_SUGGESTS/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake diff --git a/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake deleted file mode 100644 index 85e137f..0000000 --- a/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake +++ /dev/null @@ -1,18 +0,0 @@ -set(foo_preinst "^echo default_preinst$") -# NOTE: optional dot at the end of permissions regex is for SELinux enabled systems -set(foo_preinst_permissions_regex "-rwxr-xr-x\.? .*") -set(foo_prerm "^echo default_prerm$") -set(foo_prerm_permissions_regex "-rwxr-xr-x\.? .*") -verifyDebControl("${FOUND_FILE_1}" "foo" "preinst;prerm") - -set(bar_preinst "^echo bar_preinst$") -set(bar_preinst_permissions_regex "-rwx------\.? .*") -set(bar_prerm "^echo bar_prerm$") -set(bar_prerm_permissions_regex "-rwx------\.? .*") -verifyDebControl("${FOUND_FILE_2}" "bar" "preinst;prerm") - -set(bas_preinst "^echo default_preinst$") -set(bas_preinst_permissions_regex "-rwxr-xr-x\.? .*") -set(bas_prerm "^echo default_prerm$") -set(bas_prerm_permissions_regex "-rwxr-xr-x\.? .*") -verifyDebControl("${FOUND_FILE_3}" "bas" "preinst;prerm") diff --git a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-VerifyResult.cmake deleted file mode 100644 index f5d97db..0000000 --- a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS-VerifyResult.cmake +++ /dev/null @@ -1,4 +0,0 @@ -set(shlibs_shlibs "^libtest_lib 0\\.8 deb_generate_shlibs \\(\\= 0\\.1\\.1\\)\n$") -# optional dot at the end of permissions regex is for SELinux enabled systems -set(shlibs_shlibs_permissions_regex "-rw-r--r--\.? .*") -verifyDebControl("${FOUND_FILE_1}" "shlibs" "shlibs") diff --git a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-VerifyResult.cmake deleted file mode 100644 index 320732b..0000000 --- a/Tests/RunCMake/CPack/DEB/DEB_GENERATE_SHLIBS_LDCONFIG-VerifyResult.cmake +++ /dev/null @@ -1,8 +0,0 @@ -set(shlibs_shlibs "^libtest_lib 0\\.8 deb_generate_shlibs_ldconfig \\(>\\= 0\\.1\\.1\\)\n$") -# NOTE: optional dot at the end of permissions regex is for SELinux enabled systems -set(shlibs_shlibs_permissions_regex "-rw-r--r--\.? .*") -set(shlibs_postinst ".*ldconfig.*") -set(shlibs_postinst_permissions_regex "-rwxr-xr-x\.? .*") -set(shlibs_postrm ".*ldconfig.*") -set(shlibs_postrm_permissions_regex "-rwxr-xr-x\.? .*") -verifyDebControl("${FOUND_FILE_1}" "shlibs" "shlibs;postinst;postrm") diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake deleted file mode 100644 index ba39f2e..0000000 --- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-VerifyResult.cmake +++ /dev/null @@ -1,34 +0,0 @@ -function(checkDependencies_ FILE REGEX) - set(whitespaces_ "[\t\n\r ]*") - - getPackageInfo("${FILE}" "FILE_INFO_") - if(NOT FILE_INFO_ MATCHES "${REGEX}") - message(FATAL_ERROR "Unexpected dependencies in '${FILE}'; file info: '${FILE_INFO_}'") - endif() -endfunction() - -foreach(dependency_type_ DEPENDS CONFLICTS ENHANCES BREAKS REPLACES RECOMMENDS SUGGESTS) - string(TOLOWER "${dependency_type_}" lower_dependency_type_) - string(SUBSTRING ${lower_dependency_type_} 1 -1 lower_dependency_type_tail_) - string(SUBSTRING ${dependency_type_} 0 1 dependency_type_head_) - set(dependency_type_name_ "${dependency_type_head_}${lower_dependency_type_tail_}") - - checkDependencies_("${FOUND_FILE_1}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b.*") - checkDependencies_("${FOUND_FILE_2}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}.*${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b.*") - checkDependencies_("${FOUND_FILE_3}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-headers.*") - checkDependencies_("${FOUND_FILE_4}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b.*") - checkDependencies_("${FOUND_FILE_5}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b.*") -endforeach() - -checkDependencies_("${FOUND_FILE_1}" ".*Provides${whitespaces_}:${whitespaces_}provided-default, provided-default-b") -checkDependencies_("${FOUND_FILE_2}" ".*Provides${whitespaces_}:${whitespaces_}provided-default, provided-default-b") -checkDependencies_("${FOUND_FILE_3}" ".*Provides${whitespaces_}:${whitespaces_}provided-default, provided-default-b") -checkDependencies_("${FOUND_FILE_4}" ".*Provides${whitespaces_}:${whitespaces_}provided-lib.*") -checkDependencies_("${FOUND_FILE_5}" ".*Provides${whitespaces_}:${whitespaces_}provided-lib_auto.*, provided-lib_auto-b.*") - -# PREDEPENDS -checkDependencies_("${FOUND_FILE_1}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-application, predepends-application-b.*") -checkDependencies_("${FOUND_FILE_2}" ".*Pre-Depends${whitespaces_}:${whitespaces_}.*predepends-application, predepends-application-b.*") -checkDependencies_("${FOUND_FILE_3}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-headers.*") -checkDependencies_("${FOUND_FILE_4}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-default, predepends-default-b.*") -checkDependencies_("${FOUND_FILE_5}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-default, predepends-default-b.*") diff --git a/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-VerifyResult.cmake deleted file mode 100644 index 0452343..0000000 --- a/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-VerifyResult.cmake +++ /dev/null @@ -1,26 +0,0 @@ -# create structure required by non root dpkg install -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root_dir") -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir") -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir/updates") -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir/info") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir/available" "") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir/status" "") - -# some programs used by fakeroot require sbin in path so we should not -# leave this to chance (programs: ldconfig and start-stop-daemon) -set(ENV{PATH} "$ENV{PATH}:/usr/local/sbin:/usr/sbin:/sbin") - -execute_process(COMMAND ${FAKEROOT_EXECUTABLE} ${DPKG_EXECUTABLE} - -i --force-not-root --root=${CMAKE_CURRENT_BINARY_DIR}/root_dir - --admindir=${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir - --log=${CMAKE_CURRENT_BINARY_DIR}/root_dir/dpkg.log - ${FOUND_FILE_1} - RESULT_VARIABLE install_result_ - ERROR_VARIABLE install_error_ - OUTPUT_QUIET - ) - -if(install_result_) - message(FATAL_ERROR "LONG_FILENAMES package error - result:" - " '${install_result_}'; text: '${install_error_}'") -endif() diff --git a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-VerifyResult.cmake deleted file mode 100644 index 0f69925..0000000 --- a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-VerifyResult.cmake +++ /dev/null @@ -1,18 +0,0 @@ -function(checkPackageInfo_ TYPE FILE REGEX) - set(whitespaces_ "[\t\n\r ]*") - - getPackageInfo("${FILE}" "FILE_INFO_") - if(NOT FILE_INFO_ MATCHES "${REGEX}") - message(FATAL_ERROR "Unexpected ${TYPE} in '${FILE}'; file info: '${FILE_INFO_}'") - endif() -endfunction() - -# check package name -checkPackageInfo_("name" "${FOUND_FILE_1}" ".*Package${whitespaces_}:${whitespaces_}per_component_fields-pkg_1") -checkPackageInfo_("name" "${FOUND_FILE_2}" ".*Package${whitespaces_}:${whitespaces_}second") -checkPackageInfo_("name" "${FOUND_FILE_3}" ".*Package${whitespaces_}:${whitespaces_}per_component_fields-pkg_3") - -# check package group -checkPackageInfo_("group" "${FOUND_FILE_1}" ".*Section${whitespaces_}:${whitespaces_}default") -checkPackageInfo_("group" "${FOUND_FILE_2}" ".*Section${whitespaces_}:${whitespaces_}second_group") -checkPackageInfo_("group" "${FOUND_FILE_3}" ".*Section${whitespaces_}:${whitespaces_}default") diff --git a/Tests/RunCMake/CPack/RPM/DEPENDENCIES-VerifyResult.cmake b/Tests/RunCMake/CPack/RPM/DEPENDENCIES-VerifyResult.cmake deleted file mode 100644 index fec8889..0000000 --- a/Tests/RunCMake/CPack/RPM/DEPENDENCIES-VerifyResult.cmake +++ /dev/null @@ -1,45 +0,0 @@ -function(checkDependencies_ FILE TYPE COMPARE_LIST) - set(whitespaces_ "[\t\n\r ]*") - - execute_process(COMMAND ${RPM_EXECUTABLE} -qp --${TYPE} ${FILE} - WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" - OUTPUT_VARIABLE FILE_DEPENDENCIES_ - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - - string(REPLACE "\n" ";" FILE_DEPENDENCIES_LIST_ "${FILE_DEPENDENCIES_}") - - foreach(COMPARE_REGEX_ IN LISTS COMPARE_LIST) - unset(FOUND_) - - foreach(COMPARE_ IN LISTS FILE_DEPENDENCIES_LIST_) - if(COMPARE_ MATCHES "${COMPARE_REGEX_}") - set(FOUND_ true) - break() - endif() - endforeach() - - if(NOT FOUND_) - message(FATAL_ERROR "Missing dependencies in '${FILE}'; check type: '${TYPE}'; file info: '${FILE_DEPENDENCIES_}'; missing: '${COMPARE_REGEX_}'") - endif() - endforeach() -endfunction() - -# TODO add tests for what should not be present in lists -checkDependencies_("${FOUND_FILE_1}" "requires" "depend-application;depend-application-b") -checkDependencies_("${FOUND_FILE_2}" "requires" "depend-application;depend-application-b;libtest_lib\\.so.*") -checkDependencies_("${FOUND_FILE_3}" "requires" "depend-headers") -checkDependencies_("${FOUND_FILE_4}" "requires" "depend-default;depend-default-b") -checkDependencies_("${FOUND_FILE_5}" "requires" "depend-default;depend-default-b") - -checkDependencies_("${FOUND_FILE_1}" "conflicts" "conflict-application;conflict-application-b") -checkDependencies_("${FOUND_FILE_2}" "conflicts" "conflict-application;conflict-application-b") -checkDependencies_("${FOUND_FILE_3}" "conflicts" "conflict-headers") -checkDependencies_("${FOUND_FILE_4}" "conflicts" "conflict-default;conflict-default-b") -checkDependencies_("${FOUND_FILE_5}" "conflicts" "conflict-default;conflict-default-b") - -checkDependencies_("${FOUND_FILE_1}" "provides" "provided-default;provided-default-b") -checkDependencies_("${FOUND_FILE_2}" "provides" "provided-default;provided-default-b") -checkDependencies_("${FOUND_FILE_3}" "provides" "provided-default;provided-default-b") -checkDependencies_("${FOUND_FILE_4}" "provides" "provided-lib") -checkDependencies_("${FOUND_FILE_5}" "provides" "provided-lib_auto;provided-lib_auto-b") diff --git a/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-VerifyResult.cmake b/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-VerifyResult.cmake deleted file mode 100644 index d7d82f2..0000000 --- a/Tests/RunCMake/CPack/RPM/INSTALL_SCRIPTS-VerifyResult.cmake +++ /dev/null @@ -1,29 +0,0 @@ -function(checkScripts_ FILE COMPARE_LIST) - set(whitespaces_ "[\t\n\r ]*") - - execute_process(COMMAND ${RPM_EXECUTABLE} -qp --scripts ${FILE} - WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" - OUTPUT_VARIABLE FILE_SCRIPTS_ - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - - string(REPLACE "\n" ";" FILE_SCRIPTS_LIST_ "${FILE_SCRIPTS_}") - - foreach(COMPARE_REGEX_ IN LISTS COMPARE_LIST) - unset(FOUND_) - - foreach(COMPARE_ IN LISTS FILE_SCRIPTS_LIST_) - if(COMPARE_ MATCHES "${COMPARE_REGEX_}") - set(FOUND_ true) - break() - endif() - endforeach() - - if(NOT FOUND_) - message(FATAL_ERROR "Missing scripts in '${FILE}'; file info: '${FILE_SCRIPTS_}'; missing: '${COMPARE_REGEX_}'") - endif() - endforeach() -endfunction() - -checkScripts_("${FOUND_FILE_1}" "echo \"pre install foo\";echo \"post install foo\";echo \"pre uninstall foo\";echo \"post uninstall foo\"") -checkScripts_("${FOUND_FILE_2}" "echo \"pre install\";echo \"post install\";echo \"pre uninstall\";echo \"post uninstall\"") diff --git a/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-VerifyResult.cmake b/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-VerifyResult.cmake deleted file mode 100644 index 1ff9a22..0000000 --- a/Tests/RunCMake/CPack/RPM/PER_COMPONENT_FIELDS-VerifyResult.cmake +++ /dev/null @@ -1,18 +0,0 @@ -function(checkPackageInfo_ TYPE FILE REGEX) - set(whitespaces_ "[\t\n\r ]*") - - getPackageInfo("${FILE}" "FILE_INFO_") - if(NOT FILE_INFO_ MATCHES "${REGEX}") - message(FATAL_ERROR "Unexpected ${TYPE} in '${FILE}'; file info: '${FILE_INFO_}'") - endif() -endfunction() - -# check package name -checkPackageInfo_("name" "${FOUND_FILE_1}" ".*Name${whitespaces_}:${whitespaces_}per_component_fields-pkg_1") -checkPackageInfo_("name" "${FOUND_FILE_2}" ".*Name${whitespaces_}:${whitespaces_}second") -checkPackageInfo_("name" "${FOUND_FILE_3}" ".*Name${whitespaces_}:${whitespaces_}per_component_fields-pkg_3") - -# check package group -checkPackageInfo_("group" "${FOUND_FILE_1}" ".*Group${whitespaces_}:${whitespaces_}default") -checkPackageInfo_("group" "${FOUND_FILE_2}" ".*Group${whitespaces_}:${whitespaces_}second_group") -checkPackageInfo_("group" "${FOUND_FILE_3}" ".*Group${whitespaces_}:${whitespaces_}default") diff --git a/Tests/RunCMake/CPack/RPM/RPM_DIST-VerifyResult.cmake b/Tests/RunCMake/CPack/RPM/RPM_DIST-VerifyResult.cmake deleted file mode 100644 index 7375ecc..0000000 --- a/Tests/RunCMake/CPack/RPM/RPM_DIST-VerifyResult.cmake +++ /dev/null @@ -1,11 +0,0 @@ -execute_process(COMMAND ${RPMBUILD_EXECUTABLE} -E %{?dist} - OUTPUT_VARIABLE DIST_TAG - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - -set(whitespaces_ "[\t\n\r ]*") - -getPackageInfo("${FOUND_FILE_1}" "FILE_INFO_") -if(NOT FILE_INFO_ MATCHES ".*Release${whitespaces_}:${whitespaces_}1${DIST_TAG}") - message(FATAL_ERROR "Unexpected Release in '${FOUND_FILE_1}'; file info: '${FILE_INFO_}'") -endif() diff --git a/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake b/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake deleted file mode 100644 index 32cc6d1..0000000 --- a/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake +++ /dev/null @@ -1,31 +0,0 @@ -execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --querytags - OUTPUT_VARIABLE RPMBUILD_CAPS - RESULT_VARIABLE RPMBUILD_CAPS_RESULT) - -if(NOT RPMBUILD_CAPS_RESULT) - string(REPLACE "\n" ";" RPMBUILD_CAPS "${RPMBUILD_CAPS}") - cmake_policy(PUSH) - cmake_policy(SET CMP0057 NEW) - if(SUGGESTS IN_LIST RPMBUILD_CAPS) - set(should_contain_suggests_tag_ true) - endif() - cmake_policy(POP) -endif() - -# Only verify that suggests tag is present only if that tag is supported. -# If it is not supported the rpm package was corretly generated by ignoring -# that tag and that was already checked by expected files test. -if(should_contain_suggests_tag_) - execute_process(COMMAND ${RPM_EXECUTABLE} -q --suggests -p "${FOUND_FILE_1}" - WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" - RESULT_VARIABLE rpm_result_ - OUTPUT_VARIABLE rpm_output_ - ERROR_VARIABLE error_variable_ - OUTPUT_STRIP_TRAILING_WHITESPACE) - - if(rpm_result_ OR NOT rpm_output_ STREQUAL "libsuggested") - message(FATAL_ERROR "RPM_SUGGESTED package error: no suggested packages" - " (result: '${rpm_result_}'; output: '${rpm_output_}';" - " error: '${error_variable_}')") - endif() -endif() diff --git a/Tests/RunCMake/CPack/RPM/SOURCE_PACKAGE-VerifyResult.cmake b/Tests/RunCMake/CPack/RPM/SOURCE_PACKAGE-VerifyResult.cmake deleted file mode 100644 index a84e296..0000000 --- a/Tests/RunCMake/CPack/RPM/SOURCE_PACKAGE-VerifyResult.cmake +++ /dev/null @@ -1,63 +0,0 @@ -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") -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS") -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/SOURCES") -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/SPECS") -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/SRPMS") - -# make sure that we are using the version of cmake and cpack that we are testing -get_filename_component(cpack_path_ "${CMAKE_CPACK_COMMAND}" DIRECTORY) -set(ENV{PATH} "${cpack_path_}:$ENV{PATH}") - -execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --define "_topdir ${CMAKE_CURRENT_BINARY_DIR}/test_rpm" --rebuild ${FOUND_FILE_1} - RESULT_VARIABLE result_ - ERROR_VARIABLE error_ - OUTPUT_QUIET - ) - -set(output_error_message_ - "\n${RPMBUILD_EXECUTABLE} error: '${error_}';\nresult: '${result_}';\n${output_error_message}") - -set(EXPECTED_FILE_CONTENT_ "^/foo${whitespaces_}/foo/test_prog$") - -file(GLOB_RECURSE FOUND_FILE_ RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS" "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS/*.rpm") -list(APPEND foundFiles_ "${FOUND_FILE_}") -list(LENGTH FOUND_FILE_ foundFilesCount_) - -if(foundFilesCount_ EQUAL 1) - unset(PACKAGE_CONTENT) - getPackageContent("${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS/${FOUND_FILE_}" "PACKAGE_CONTENT") - - string(REGEX MATCH "${EXPECTED_FILE_CONTENT_}" - expected_content_list "${PACKAGE_CONTENT}") - - if(NOT expected_content_list) - message(FATAL_ERROR - "Unexpected file content!\n" - " Content: '${PACKAGE_CONTENT}'\n\n" - " Expected: '${EXPECTED_FILE_CONTENT_}'" - "${output_error_message_}") - endif() -else() - message(FATAL_ERROR - "Found more than one file!" - " Found files count '${foundFilesCount_}'." - " Files: '${FOUND_FILE_}'" - "${output_error_message_}") -endif() - -# check that there were no extra files generated -foreach(all_files_glob_ IN LISTS ALL_FILES_GLOB) - file(GLOB foundAll_ RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS" "${all_files_glob_}") - list(APPEND allFoundFiles_ "${foundAll_}") -endforeach() - -list(LENGTH foundFiles_ foundFilesCount_) -list(LENGTH allFoundFiles_ allFoundFilesCount_) - -if(NOT foundFilesCount_ EQUAL allFoundFilesCount_) - message(FATAL_ERROR - "Found more files than expected! Found files: '${allFoundFiles_}'" - "${output_error_message_}") -endif() diff --git a/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake b/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake deleted file mode 100644 index e4f9618..0000000 --- a/Tests/RunCMake/CPack/TGZ/PACKAGE_CHECKSUM-VerifyResult.cmake +++ /dev/null @@ -1,12 +0,0 @@ -if(NOT ${RunCMake_SUBTEST_SUFFIX} MATCHES "invalid") - string(TOLOWER ${RunCMake_SUBTEST_SUFFIX} EXTENSION) - file(GLOB PACKAGE RELATIVE ${bin_dir} "*.tar.gz") - file(GLOB CSUMFILE RELATIVE ${bin_dir} "*.${EXTENSION}") - file(STRINGS ${CSUMFILE} CHSUM_VALUE) - file(${RunCMake_SUBTEST_SUFFIX} ${PACKAGE} expected_value ) - set(expected_value "${expected_value} ${PACKAGE}") - - if(NOT expected_value STREQUAL CHSUM_VALUE) - message(FATAL_ERROR "Generated checksum is not valid! Expected [${expected_value}] Got [${CHSUM_VALUE}]") - endif() -endif() diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake index 803b4bc..9ab6f11 100644 --- a/Tests/RunCMake/CPack/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/VerifyResult.cmake @@ -84,8 +84,8 @@ else() endif() # handle additional result verifications -if(EXISTS "${src_dir}/${GENERATOR_TYPE}/${RunCMake_TEST_FILE_PREFIX}-VerifyResult.cmake") - include("${src_dir}/${GENERATOR_TYPE}/${RunCMake_TEST_FILE_PREFIX}-VerifyResult.cmake") +if(EXISTS "${src_dir}/tests/${RunCMake_TEST_FILE_PREFIX}/VerifyResult.cmake") + include("${src_dir}/tests/${RunCMake_TEST_FILE_PREFIX}/VerifyResult.cmake") endif() message(STATUS "${output}") diff --git a/Tests/RunCMake/CPack/tests/DEB_EXTRA/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DEB_EXTRA/VerifyResult.cmake new file mode 100644 index 0000000..85e137f --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEB_EXTRA/VerifyResult.cmake @@ -0,0 +1,18 @@ +set(foo_preinst "^echo default_preinst$") +# NOTE: optional dot at the end of permissions regex is for SELinux enabled systems +set(foo_preinst_permissions_regex "-rwxr-xr-x\.? .*") +set(foo_prerm "^echo default_prerm$") +set(foo_prerm_permissions_regex "-rwxr-xr-x\.? .*") +verifyDebControl("${FOUND_FILE_1}" "foo" "preinst;prerm") + +set(bar_preinst "^echo bar_preinst$") +set(bar_preinst_permissions_regex "-rwx------\.? .*") +set(bar_prerm "^echo bar_prerm$") +set(bar_prerm_permissions_regex "-rwx------\.? .*") +verifyDebControl("${FOUND_FILE_2}" "bar" "preinst;prerm") + +set(bas_preinst "^echo default_preinst$") +set(bas_preinst_permissions_regex "-rwxr-xr-x\.? .*") +set(bas_prerm "^echo default_prerm$") +set(bas_prerm_permissions_regex "-rwxr-xr-x\.? .*") +verifyDebControl("${FOUND_FILE_3}" "bas" "preinst;prerm") diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/VerifyResult.cmake new file mode 100644 index 0000000..f5d97db --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/VerifyResult.cmake @@ -0,0 +1,4 @@ +set(shlibs_shlibs "^libtest_lib 0\\.8 deb_generate_shlibs \\(\\= 0\\.1\\.1\\)\n$") +# optional dot at the end of permissions regex is for SELinux enabled systems +set(shlibs_shlibs_permissions_regex "-rw-r--r--\.? .*") +verifyDebControl("${FOUND_FILE_1}" "shlibs" "shlibs") diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake new file mode 100644 index 0000000..320732b --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake @@ -0,0 +1,8 @@ +set(shlibs_shlibs "^libtest_lib 0\\.8 deb_generate_shlibs_ldconfig \\(>\\= 0\\.1\\.1\\)\n$") +# NOTE: optional dot at the end of permissions regex is for SELinux enabled systems +set(shlibs_shlibs_permissions_regex "-rw-r--r--\.? .*") +set(shlibs_postinst ".*ldconfig.*") +set(shlibs_postinst_permissions_regex "-rwxr-xr-x\.? .*") +set(shlibs_postrm ".*ldconfig.*") +set(shlibs_postrm_permissions_regex "-rwxr-xr-x\.? .*") +verifyDebControl("${FOUND_FILE_1}" "shlibs" "shlibs;postinst;postrm") diff --git a/Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake new file mode 100644 index 0000000..1c7ff5e --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake @@ -0,0 +1,82 @@ +if(GENERATOR_TYPE STREQUAL "DEB") + function(checkDependencies_ FILE REGEX) + set(whitespaces_ "[\t\n\r ]*") + + getPackageInfo("${FILE}" "FILE_INFO_") + if(NOT FILE_INFO_ MATCHES "${REGEX}") + message(FATAL_ERROR "Unexpected dependencies in '${FILE}'; file info: '${FILE_INFO_}'") + endif() + endfunction() + + foreach(dependency_type_ DEPENDS CONFLICTS ENHANCES BREAKS REPLACES RECOMMENDS SUGGESTS) + string(TOLOWER "${dependency_type_}" lower_dependency_type_) + string(SUBSTRING ${lower_dependency_type_} 1 -1 lower_dependency_type_tail_) + string(SUBSTRING ${dependency_type_} 0 1 dependency_type_head_) + set(dependency_type_name_ "${dependency_type_head_}${lower_dependency_type_tail_}") + + checkDependencies_("${FOUND_FILE_1}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b.*") + checkDependencies_("${FOUND_FILE_2}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}.*${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b.*") + checkDependencies_("${FOUND_FILE_3}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-headers.*") + checkDependencies_("${FOUND_FILE_4}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b.*") + checkDependencies_("${FOUND_FILE_5}" ".*${dependency_type_name_}${whitespaces_}:${whitespaces_}${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b.*") + endforeach() + + checkDependencies_("${FOUND_FILE_1}" ".*Provides${whitespaces_}:${whitespaces_}provided-default, provided-default-b") + checkDependencies_("${FOUND_FILE_2}" ".*Provides${whitespaces_}:${whitespaces_}provided-default, provided-default-b") + checkDependencies_("${FOUND_FILE_3}" ".*Provides${whitespaces_}:${whitespaces_}provided-default, provided-default-b") + checkDependencies_("${FOUND_FILE_4}" ".*Provides${whitespaces_}:${whitespaces_}provided-lib.*") + checkDependencies_("${FOUND_FILE_5}" ".*Provides${whitespaces_}:${whitespaces_}provided-lib_auto.*, provided-lib_auto-b.*") + + # PREDEPENDS + checkDependencies_("${FOUND_FILE_1}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-application, predepends-application-b.*") + checkDependencies_("${FOUND_FILE_2}" ".*Pre-Depends${whitespaces_}:${whitespaces_}.*predepends-application, predepends-application-b.*") + checkDependencies_("${FOUND_FILE_3}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-headers.*") + checkDependencies_("${FOUND_FILE_4}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-default, predepends-default-b.*") + checkDependencies_("${FOUND_FILE_5}" ".*Pre-Depends${whitespaces_}:${whitespaces_}predepends-default, predepends-default-b.*") +elseif(GENERATOR_TYPE STREQUAL "RPM") + function(checkDependencies_ FILE TYPE COMPARE_LIST) + set(whitespaces_ "[\t\n\r ]*") + + execute_process(COMMAND ${RPM_EXECUTABLE} -qp --${TYPE} ${FILE} + WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" + OUTPUT_VARIABLE FILE_DEPENDENCIES_ + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + string(REPLACE "\n" ";" FILE_DEPENDENCIES_LIST_ "${FILE_DEPENDENCIES_}") + + foreach(COMPARE_REGEX_ IN LISTS COMPARE_LIST) + unset(FOUND_) + + foreach(COMPARE_ IN LISTS FILE_DEPENDENCIES_LIST_) + if(COMPARE_ MATCHES "${COMPARE_REGEX_}") + set(FOUND_ true) + break() + endif() + endforeach() + + if(NOT FOUND_) + message(FATAL_ERROR "Missing dependencies in '${FILE}'; check type: '${TYPE}'; file info: '${FILE_DEPENDENCIES_}'; missing: '${COMPARE_REGEX_}'") + endif() + endforeach() + endfunction() + + # TODO add tests for what should not be present in lists + checkDependencies_("${FOUND_FILE_1}" "requires" "depend-application;depend-application-b") + checkDependencies_("${FOUND_FILE_2}" "requires" "depend-application;depend-application-b;libtest_lib\\.so.*") + checkDependencies_("${FOUND_FILE_3}" "requires" "depend-headers") + checkDependencies_("${FOUND_FILE_4}" "requires" "depend-default;depend-default-b") + checkDependencies_("${FOUND_FILE_5}" "requires" "depend-default;depend-default-b") + + checkDependencies_("${FOUND_FILE_1}" "conflicts" "conflict-application;conflict-application-b") + checkDependencies_("${FOUND_FILE_2}" "conflicts" "conflict-application;conflict-application-b") + checkDependencies_("${FOUND_FILE_3}" "conflicts" "conflict-headers") + checkDependencies_("${FOUND_FILE_4}" "conflicts" "conflict-default;conflict-default-b") + checkDependencies_("${FOUND_FILE_5}" "conflicts" "conflict-default;conflict-default-b") + + checkDependencies_("${FOUND_FILE_1}" "provides" "provided-default;provided-default-b") + checkDependencies_("${FOUND_FILE_2}" "provides" "provided-default;provided-default-b") + checkDependencies_("${FOUND_FILE_3}" "provides" "provided-default;provided-default-b") + checkDependencies_("${FOUND_FILE_4}" "provides" "provided-lib") + checkDependencies_("${FOUND_FILE_5}" "provides" "provided-lib_auto;provided-lib_auto-b") +endif() diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake new file mode 100644 index 0000000..d7d82f2 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake @@ -0,0 +1,29 @@ +function(checkScripts_ FILE COMPARE_LIST) + set(whitespaces_ "[\t\n\r ]*") + + execute_process(COMMAND ${RPM_EXECUTABLE} -qp --scripts ${FILE} + WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" + OUTPUT_VARIABLE FILE_SCRIPTS_ + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + string(REPLACE "\n" ";" FILE_SCRIPTS_LIST_ "${FILE_SCRIPTS_}") + + foreach(COMPARE_REGEX_ IN LISTS COMPARE_LIST) + unset(FOUND_) + + foreach(COMPARE_ IN LISTS FILE_SCRIPTS_LIST_) + if(COMPARE_ MATCHES "${COMPARE_REGEX_}") + set(FOUND_ true) + break() + endif() + endforeach() + + if(NOT FOUND_) + message(FATAL_ERROR "Missing scripts in '${FILE}'; file info: '${FILE_SCRIPTS_}'; missing: '${COMPARE_REGEX_}'") + endif() + endforeach() +endfunction() + +checkScripts_("${FOUND_FILE_1}" "echo \"pre install foo\";echo \"post install foo\";echo \"pre uninstall foo\";echo \"post uninstall foo\"") +checkScripts_("${FOUND_FILE_2}" "echo \"pre install\";echo \"post install\";echo \"pre uninstall\";echo \"post uninstall\"") diff --git a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/VerifyResult.cmake new file mode 100644 index 0000000..0452343 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/VerifyResult.cmake @@ -0,0 +1,26 @@ +# create structure required by non root dpkg install +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root_dir") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir/updates") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir/info") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir/available" "") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir/status" "") + +# some programs used by fakeroot require sbin in path so we should not +# leave this to chance (programs: ldconfig and start-stop-daemon) +set(ENV{PATH} "$ENV{PATH}:/usr/local/sbin:/usr/sbin:/sbin") + +execute_process(COMMAND ${FAKEROOT_EXECUTABLE} ${DPKG_EXECUTABLE} + -i --force-not-root --root=${CMAKE_CURRENT_BINARY_DIR}/root_dir + --admindir=${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir + --log=${CMAKE_CURRENT_BINARY_DIR}/root_dir/dpkg.log + ${FOUND_FILE_1} + RESULT_VARIABLE install_result_ + ERROR_VARIABLE install_error_ + OUTPUT_QUIET + ) + +if(install_result_) + message(FATAL_ERROR "LONG_FILENAMES package error - result:" + " '${install_result_}'; text: '${install_error_}'") +endif() diff --git a/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/VerifyResult.cmake new file mode 100644 index 0000000..e4f9618 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/VerifyResult.cmake @@ -0,0 +1,12 @@ +if(NOT ${RunCMake_SUBTEST_SUFFIX} MATCHES "invalid") + string(TOLOWER ${RunCMake_SUBTEST_SUFFIX} EXTENSION) + file(GLOB PACKAGE RELATIVE ${bin_dir} "*.tar.gz") + file(GLOB CSUMFILE RELATIVE ${bin_dir} "*.${EXTENSION}") + file(STRINGS ${CSUMFILE} CHSUM_VALUE) + file(${RunCMake_SUBTEST_SUFFIX} ${PACKAGE} expected_value ) + set(expected_value "${expected_value} ${PACKAGE}") + + if(NOT expected_value STREQUAL CHSUM_VALUE) + message(FATAL_ERROR "Generated checksum is not valid! Expected [${expected_value}] Got [${CHSUM_VALUE}]") + endif() +endif() diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake new file mode 100644 index 0000000..18ef63c --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake @@ -0,0 +1,26 @@ +function(checkPackageInfo_ TYPE FILE REGEX) + getPackageInfo("${FILE}" "FILE_INFO_") + if(NOT FILE_INFO_ MATCHES "${REGEX}") + message(FATAL_ERROR "Unexpected ${TYPE} in '${FILE}'; file info: '${FILE_INFO_}'") + endif() +endfunction() + +if(GENERATOR_TYPE STREQUAL "DEB") + set(name_ "Package") + set(group_ "Section") +elseif(GENERATOR_TYPE STREQUAL "RPM") + set(name_ "Name") + set(group_ "Group") +endif() + +set(whitespaces_ "[\t\n\r ]*") + +# check package name +checkPackageInfo_("name" "${FOUND_FILE_1}" ".*${name_}${whitespaces_}:${whitespaces_}per_component_fields-pkg_1") +checkPackageInfo_("name" "${FOUND_FILE_2}" ".*${name_}${whitespaces_}:${whitespaces_}second") +checkPackageInfo_("name" "${FOUND_FILE_3}" ".*${name_}${whitespaces_}:${whitespaces_}per_component_fields-pkg_3") + +# check package group +checkPackageInfo_("group" "${FOUND_FILE_1}" ".*${group_}${whitespaces_}:${whitespaces_}default") +checkPackageInfo_("group" "${FOUND_FILE_2}" ".*${group_}${whitespaces_}:${whitespaces_}second_group") +checkPackageInfo_("group" "${FOUND_FILE_3}" ".*${group_}${whitespaces_}:${whitespaces_}default") diff --git a/Tests/RunCMake/CPack/tests/RPM_DIST/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/RPM_DIST/VerifyResult.cmake new file mode 100644 index 0000000..7375ecc --- /dev/null +++ b/Tests/RunCMake/CPack/tests/RPM_DIST/VerifyResult.cmake @@ -0,0 +1,11 @@ +execute_process(COMMAND ${RPMBUILD_EXECUTABLE} -E %{?dist} + OUTPUT_VARIABLE DIST_TAG + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + +set(whitespaces_ "[\t\n\r ]*") + +getPackageInfo("${FOUND_FILE_1}" "FILE_INFO_") +if(NOT FILE_INFO_ MATCHES ".*Release${whitespaces_}:${whitespaces_}1${DIST_TAG}") + message(FATAL_ERROR "Unexpected Release in '${FOUND_FILE_1}'; file info: '${FILE_INFO_}'") +endif() diff --git a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/VerifyResult.cmake new file mode 100644 index 0000000..32cc6d1 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/VerifyResult.cmake @@ -0,0 +1,31 @@ +execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --querytags + OUTPUT_VARIABLE RPMBUILD_CAPS + RESULT_VARIABLE RPMBUILD_CAPS_RESULT) + +if(NOT RPMBUILD_CAPS_RESULT) + string(REPLACE "\n" ";" RPMBUILD_CAPS "${RPMBUILD_CAPS}") + cmake_policy(PUSH) + cmake_policy(SET CMP0057 NEW) + if(SUGGESTS IN_LIST RPMBUILD_CAPS) + set(should_contain_suggests_tag_ true) + endif() + cmake_policy(POP) +endif() + +# Only verify that suggests tag is present only if that tag is supported. +# If it is not supported the rpm package was corretly generated by ignoring +# that tag and that was already checked by expected files test. +if(should_contain_suggests_tag_) + execute_process(COMMAND ${RPM_EXECUTABLE} -q --suggests -p "${FOUND_FILE_1}" + WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" + RESULT_VARIABLE rpm_result_ + OUTPUT_VARIABLE rpm_output_ + ERROR_VARIABLE error_variable_ + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(rpm_result_ OR NOT rpm_output_ STREQUAL "libsuggested") + message(FATAL_ERROR "RPM_SUGGESTED package error: no suggested packages" + " (result: '${rpm_result_}'; output: '${rpm_output_}';" + " error: '${error_variable_}')") + endif() +endif() diff --git a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake new file mode 100644 index 0000000..a84e296 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake @@ -0,0 +1,63 @@ +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") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/SOURCES") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/SPECS") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/SRPMS") + +# make sure that we are using the version of cmake and cpack that we are testing +get_filename_component(cpack_path_ "${CMAKE_CPACK_COMMAND}" DIRECTORY) +set(ENV{PATH} "${cpack_path_}:$ENV{PATH}") + +execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --define "_topdir ${CMAKE_CURRENT_BINARY_DIR}/test_rpm" --rebuild ${FOUND_FILE_1} + RESULT_VARIABLE result_ + ERROR_VARIABLE error_ + OUTPUT_QUIET + ) + +set(output_error_message_ + "\n${RPMBUILD_EXECUTABLE} error: '${error_}';\nresult: '${result_}';\n${output_error_message}") + +set(EXPECTED_FILE_CONTENT_ "^/foo${whitespaces_}/foo/test_prog$") + +file(GLOB_RECURSE FOUND_FILE_ RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS" "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS/*.rpm") +list(APPEND foundFiles_ "${FOUND_FILE_}") +list(LENGTH FOUND_FILE_ foundFilesCount_) + +if(foundFilesCount_ EQUAL 1) + unset(PACKAGE_CONTENT) + getPackageContent("${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS/${FOUND_FILE_}" "PACKAGE_CONTENT") + + string(REGEX MATCH "${EXPECTED_FILE_CONTENT_}" + expected_content_list "${PACKAGE_CONTENT}") + + if(NOT expected_content_list) + message(FATAL_ERROR + "Unexpected file content!\n" + " Content: '${PACKAGE_CONTENT}'\n\n" + " Expected: '${EXPECTED_FILE_CONTENT_}'" + "${output_error_message_}") + endif() +else() + message(FATAL_ERROR + "Found more than one file!" + " Found files count '${foundFilesCount_}'." + " Files: '${FOUND_FILE_}'" + "${output_error_message_}") +endif() + +# check that there were no extra files generated +foreach(all_files_glob_ IN LISTS ALL_FILES_GLOB) + file(GLOB foundAll_ RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS" "${all_files_glob_}") + list(APPEND allFoundFiles_ "${foundAll_}") +endforeach() + +list(LENGTH foundFiles_ foundFilesCount_) +list(LENGTH allFoundFiles_ allFoundFilesCount_) + +if(NOT foundFilesCount_ EQUAL allFoundFilesCount_) + message(FATAL_ERROR + "Found more files than expected! Found files: '${allFoundFiles_}'" + "${output_error_message_}") +endif() -- cgit v0.12 From ed8858edb7c5100e1928c5a94f85485f0e322aa7 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 27 Nov 2016 14:00:29 +0100 Subject: Tests: CPack test unify expected file naming Each generator generates its own file format with different extensions but they all create those file names by a certain pattern and all of them require the same pieces for that pattern to work. Now we can only provide pieces once and and each generator will use those pieces to generate an expected file name. --- Tests/RunCMake/CPack/DEB/Helpers.cmake | 20 +++++++++++++++ Tests/RunCMake/CPack/RPM/Helpers.cmake | 20 +++++++++++++++ Tests/RunCMake/CPack/TGZ/Helpers.cmake | 8 ++++++ Tests/RunCMake/CPack/VerifyResult.cmake | 29 ++++++++++++++++++++-- .../tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake | 5 ++-- .../CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake | 1 + .../CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake | 14 ++++++----- .../CPack/tests/DEBUGINFO/ExpectedFiles.cmake | 7 +++--- .../CPack/tests/DEB_EXTRA/ExpectedFiles.cmake | 7 +++--- .../tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake | 2 +- .../ExpectedFiles.cmake | 2 +- .../CPack/tests/DEPENDENCIES/ExpectedFiles.cmake | 15 ++++------- .../CPack/tests/EMPTY_DIR/ExpectedFiles.cmake | 4 +-- Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake | 9 ++++++- .../tests/INSTALL_SCRIPTS/ExpectedFiles.cmake | 4 +-- .../CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake | 2 +- .../CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake | 4 +-- .../CPack/tests/MINIMAL/ExpectedFiles.cmake | 3 --- Tests/RunCMake/CPack/tests/MINIMAL/test.cmake | 1 - .../tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake | 1 - .../ExpectedFiles.cmake | 1 - .../tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake | 10 +++----- .../CPack/tests/PER_COMPONENT_FIELDS/test.cmake | 1 + .../CPack/tests/RPM_DIST/ExpectedFiles.cmake | 1 - .../CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake | 1 - .../tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake | 3 ++- .../CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake | 1 - 27 files changed, 122 insertions(+), 54 deletions(-) diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake index 9b1be22..e5cda08 100644 --- a/Tests/RunCMake/CPack/DEB/Helpers.cmake +++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake @@ -9,6 +9,26 @@ function(getPackageContent FILE RESULT_VAR) set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE) endfunction() +function(getPackageNameGlobexpr NAME COMPONENT VERSION REVISION FILE_NO RESULT_VAR) + if(COMPONENT) + set(COMPONENT "-${COMPONENT}") + endif() + + if(DEFINED EXPECTED_FILE_${FILE_NO}_FILENAME_GENERATOR_SPECIFIC_FORMAT) + set(GENERATOR_SPECIFIC_FORMAT "${EXPECTED_FILE_${FILE_NO}_FILENAME_GENERATOR_SPECIFIC_FORMAT}") + elseif(DEFINED EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT) + set(GENERATOR_SPECIFIC_FORMAT "${EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT}") + else() + set(GENERATOR_SPECIFIC_FORMAT FALSE) + endif() + + if(GENERATOR_SPECIFIC_FORMAT) + set(${RESULT_VAR} "${NAME}${COMPONENT}_${VERSION}-${REVISION}_*.deb" PARENT_SCOPE) + else() + set(${RESULT_VAR} "${NAME}-${VERSION}-*${COMPONENT}.deb" PARENT_SCOPE) + endif() +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 ba77a4a..9ed03e2 100644 --- a/Tests/RunCMake/CPack/RPM/Helpers.cmake +++ b/Tests/RunCMake/CPack/RPM/Helpers.cmake @@ -9,6 +9,26 @@ function(getPackageContent FILE RESULT_VAR) set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE) endfunction() +function(getPackageNameGlobexpr NAME COMPONENT VERSION REVISION FILE_NO RESULT_VAR) + if(COMPONENT) + set(COMPONENT "-${COMPONENT}") + endif() + + if(DEFINED EXPECTED_FILE_${FILE_NO}_FILENAME_GENERATOR_SPECIFIC_FORMAT) + set(GENERATOR_SPECIFIC_FORMAT "${EXPECTED_FILE_${FILE_NO}_FILENAME_GENERATOR_SPECIFIC_FORMAT}") + elseif(DEFINED EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT) + set(GENERATOR_SPECIFIC_FORMAT "${EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT}") + else() + set(GENERATOR_SPECIFIC_FORMAT FALSE) + endif() + + if(GENERATOR_SPECIFIC_FORMAT) + set(${RESULT_VAR} "${NAME}${COMPONENT}-${VERSION}-${REVISION}.*.rpm" PARENT_SCOPE) + else() + set(${RESULT_VAR} "${NAME}-${VERSION}-*${COMPONENT}.rpm" PARENT_SCOPE) + endif() +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 f14d532..50fda9e 100644 --- a/Tests/RunCMake/CPack/TGZ/Helpers.cmake +++ b/Tests/RunCMake/CPack/TGZ/Helpers.cmake @@ -8,3 +8,11 @@ function(getPackageContent FILE RESULT_VAR) set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE) endfunction() + +function(getPackageNameGlobexpr NAME COMPONENT VERSION REVISION FILE_NO RESULT_VAR) + if(COMPONENT) + set(COMPONENT "-${COMPONENT}") + endif() + + set(${RESULT_VAR} "${NAME}-${VERSION}-*${COMPONENT}.tar.gz" PARENT_SCOPE) +endfunction() diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake index 9ab6f11..835f654 100644 --- a/Tests/RunCMake/CPack/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/VerifyResult.cmake @@ -1,5 +1,28 @@ cmake_minimum_required(VERSION ${CMAKE_VERSION} FATAL_ERROR) +function(findExpectedFile FILE_NO RESULT_VAR) + if(NOT DEFINED EXPECTED_FILE_${FILE_NO}) # explicit file name regex was not provided - construct one from other data + # set defaults if parameters are not provided + if(NOT DEFINED EXPECTED_FILE_${FILE_NO}_NAME) + string(TOLOWER "${RunCMake_TEST_FILE_PREFIX}" EXPECTED_FILE_${FILE_NO}_NAME) + endif() + if(NOT DEFINED EXPECTED_FILE_${FILE_NO}_VERSION) + set(EXPECTED_FILE_${FILE_NO}_VERSION "0.1.1") + endif() + if(NOT DEFINED EXPECTED_FILE_${FILE_NO}_REVISION) + set(EXPECTED_FILE_${FILE_NO}_REVISION "1") + endif() + + getPackageNameGlobexpr("${EXPECTED_FILE_${FILE_NO}_NAME}" + "${EXPECTED_FILE_${FILE_NO}_COMPONENT}" "${EXPECTED_FILE_${FILE_NO}_VERSION}" + "${EXPECTED_FILE_${FILE_NO}_REVISION}" "${FILE_NO}" "EXPECTED_FILE_${FILE_NO}") + endif() + + file(GLOB found_file_ RELATIVE "${bin_dir}" "${EXPECTED_FILE_${FILE_NO}}") + + set(${RESULT_VAR} "${found_file_}" PARENT_SCOPE) +endfunction() + include("${config_file}") include("${src_dir}/${GENERATOR_TYPE}/Helpers.cmake") @@ -10,12 +33,13 @@ file(READ "${config_file}" config_file_content) set(output_error_message "\nCPack output: '${output}'\nCPack error: '${error}';\nCPack result: '${PACKAGING_RESULT}';\nconfig file: '${config_file_content}'") -# check that expected generated files exist and contain expected content +# generate default expected files data include("${src_dir}/tests/${RunCMake_TEST_FILE_PREFIX}/ExpectedFiles.cmake") +# check that expected generated files exist and contain expected content if(NOT EXPECTED_FILES_COUNT EQUAL 0) foreach(file_no_ RANGE 1 ${EXPECTED_FILES_COUNT}) - file(GLOB FOUND_FILE_${file_no_} RELATIVE "${bin_dir}" "${EXPECTED_FILE_${file_no_}}") + findExpectedFile("${file_no_}" "FOUND_FILE_${file_no_}") list(APPEND foundFiles_ "${FOUND_FILE_${file_no_}}") list(LENGTH FOUND_FILE_${file_no_} foundFilesCount_) @@ -40,6 +64,7 @@ if(NOT EXPECTED_FILES_COUNT EQUAL 0) "Found more than one file for file No. '${file_no_}'!" " Found files count '${foundFilesCount_}'." " Files: '${FOUND_FILE_${file_no_}}'" + " Globbing expression: '${EXPECTED_FILE_${file_no_}}'" "${output_error_message}") endif() endforeach() diff --git a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake index f42d8b1..700f72c 100644 --- a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake @@ -1,14 +1,13 @@ 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_1 "components_empty_dir-test_0.1.1-1_*.deb") set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/empty/$") elseif(GENERATOR_TYPE STREQUAL "RPM") - set(EXPECTED_FILE_1 "components_empty_dir*.rpm") set(EXPECTED_FILE_CONTENT_1 "^/usr/empty$") elseif(GENERATOR_TYPE STREQUAL "TGZ") - set(EXPECTED_FILE_1 "components_empty_dir*.tar.gz") set(EXPECTED_FILE_CONTENT_1 "^[^\n]*empty/$") endif() diff --git a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake index 1ad01c1..1f35b80 100644 --- a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake +++ b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake @@ -4,6 +4,7 @@ if(GENERATOR_TYPE STREQUAL "DEB") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") elseif(GENERATOR_TYPE STREQUAL "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") + set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") elseif(GENERATOR_TYPE STREQUAL "TGZ") set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") endif() diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake index c0389ba..01ae2d9 100644 --- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake @@ -1,19 +1,21 @@ 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_2_NAME "second") if(GENERATOR_TYPE STREQUAL "DEB") - set(EXPECTED_FILE_1 "custom_names-pkg_1_0.1.1-1_*.deb") set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_2 "second*.deb") set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_3 "pkg_3_abc.deb") set(EXPECTED_FILE_CONTENT_3 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") elseif(GENERATOR_TYPE STREQUAL "RPM") - set(EXPECTED_FILE_1 "custom_names-pkg_1*.rpm") set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_2 "second*.rpm") set(EXPECTED_FILE_CONTENT_2 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_3 "pkg_3_abc.rpm") set(EXPECTED_FILE_CONTENT_3 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") endif() + +if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") + string(TOLOWER "${GENERATOR_TYPE}" file_extension_) + set(EXPECTED_FILE_3 "pkg_3_abc.${file_extension_}") +endif() diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake index a583e32..044744b 100644 --- a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake @@ -1,14 +1,15 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "5") -set(EXPECTED_FILE_1 "debuginfo-applications-0*.rpm") +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_2 "debuginfo*-headers.rpm") set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/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_4 "debuginfo-applications-debuginfo*.rpm") +set(EXPECTED_FILE_4_COMPONENT "applications-debuginfo") set(EXPECTED_FILE_CONTENT_4 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*") -set(EXPECTED_FILE_5 "debuginfo-libs-debuginfo*.rpm") +set(EXPECTED_FILE_5_COMPONENT "libs-debuginfo") set(EXPECTED_FILE_CONTENT_5 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/test_lib.cpp.*") diff --git a/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake index 4531a34..97b7c0b 100644 --- a/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake @@ -1,9 +1,10 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "3") -set(EXPECTED_FILE_1 "deb_extra-foo_0.1.1-1_*.deb") +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_2 "deb_extra-bar_0.1.1-1_*.deb") +set(EXPECTED_FILE_2_COMPONENT "bar") set(EXPECTED_FILE_CONTENT_2 "^.*/usr/${whitespaces_}.*/usr/bar/${whitespaces_}.*/usr/bar/CMakeLists.txt$") -set(EXPECTED_FILE_3 "deb_extra-bas_0.1.1-1_*.deb") +set(EXPECTED_FILE_3_COMPONENT "bas") set(EXPECTED_FILE_CONTENT_3 "^.*/usr/${whitespaces_}.*/usr/bas/${whitespaces_}.*/usr/bas/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake index 32a2327..ccb5ef0 100644 --- a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake @@ -1,6 +1,6 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "deb_generate_shlibs_0.1.1-1_*.deb") +set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) # dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake index 4966818..d66c044 100644 --- a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake @@ -1,6 +1,6 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "deb_generate_shlibs_ldconfig_0.1.1-1_*.deb") +set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) # dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it set(EXPECTED_FILE_CONTENT_1 "^.*/usr/lib${whitespaces_}.*/usr/lib/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/tests/DEPENDENCIES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEPENDENCIES/ExpectedFiles.cmake index 8459dd3..7ab2961 100644 --- a/Tests/RunCMake/CPack/tests/DEPENDENCIES/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/DEPENDENCIES/ExpectedFiles.cmake @@ -1,28 +1,23 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "5") +set(EXPECTED_FILE_1_COMPONENT "applications") +set(EXPECTED_FILE_2_COMPONENT "applications_auto") +set(EXPECTED_FILE_3_COMPONENT "headers") +set(EXPECTED_FILE_4_COMPONENT "libs") +set(EXPECTED_FILE_5_COMPONENT "libs_auto") if(GENERATOR_TYPE STREQUAL "DEB") - set(EXPECTED_FILE_1 "dependencies-0.1.1-*-applications.deb") set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/test_prog$") - set(EXPECTED_FILE_2 "dependencies-0.1.1-*-applications_auto.deb") set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo_auto${whitespaces_}.*/usr/foo_auto/test_prog$") - set(EXPECTED_FILE_3 "dependencies-0.1.1-*-headers.deb") set(EXPECTED_FILE_CONTENT_3 "^.*/usr/bar${whitespaces_}.*/usr/bar/CMakeLists.txt$") - set(EXPECTED_FILE_4 "dependencies-0.1.1-*-libs.deb") # 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_5 "dependencies-0.1.1-*-libs_auto.deb") set(EXPECTED_FILE_CONTENT_5 "^.*/usr/bas_auto${whitespaces_}.*/usr/bas_auto/libtest_lib\\..*$") elseif(GENERATOR_TYPE STREQUAL "RPM") - set(EXPECTED_FILE_1 "dependencies*-applications.rpm") set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/test_prog$") - set(EXPECTED_FILE_2 "dependencies*-applications_auto.rpm") set(EXPECTED_FILE_CONTENT_2 "^/usr/foo_auto${whitespaces_}/usr/foo_auto/test_prog$") - set(EXPECTED_FILE_3 "dependencies*-headers.rpm") set(EXPECTED_FILE_CONTENT_3 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") - set(EXPECTED_FILE_4 "dependencies*-libs.rpm") set(EXPECTED_FILE_CONTENT_4 "^/usr/bas${whitespaces_}/usr/bas/libtest_lib.so$") - set(EXPECTED_FILE_5 "dependencies*-libs_auto.rpm") 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 5924f1f..bdeae28 100644 --- a/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake @@ -1,14 +1,12 @@ 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_1 "empty_dir_0.1.1-1_*.deb") set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/empty/$") elseif(GENERATOR_TYPE STREQUAL "RPM") - set(EXPECTED_FILE_1 "empty_dir*.rpm") set(EXPECTED_FILE_CONTENT_1 "^/usr/empty$") elseif(GENERATOR_TYPE STREQUAL "TGZ") - set(EXPECTED_FILE_1 "empty_dir*.tar.gz") set(EXPECTED_FILE_CONTENT_1 "^[^\n]*empty_dir-0.1.1-[^\n]*/empty/$") endif() diff --git a/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake b/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake index e435ced..049c4a4 100644 --- a/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake +++ b/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake @@ -1,6 +1,13 @@ if(GENERATOR_TYPE STREQUAL "DEB") set(CPACK_PACKAGE_CONTACT "someone") - set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") +endif() + +if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") + if(GENERATOR_TYPE STREQUAL "DEB") + set(generator_type_suffix_ "IAN") # not entirely compatible... + endif() + + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_FILE_NAME "${GENERATOR_TYPE}-DEFAULT") endif() install(DIRECTORY DESTINATION empty diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake index 033a45d..36a7014 100644 --- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/ExpectedFiles.cmake @@ -1,7 +1,7 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "2") -set(EXPECTED_FILE_1 "install_scripts*-foo.rpm") +set(EXPECTED_FILE_1_COMPONENT "foo") set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") -set(EXPECTED_FILE_2 "install_scripts*-bar.rpm") +set(EXPECTED_FILE_2_COMPONENT "bar") set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/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 dd72cf7..6733228 100644 --- a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake @@ -1,5 +1,5 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "long_filenames_0.1.1-1_*.deb") +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$") diff --git a/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake index 69603dd..84a1510 100644 --- a/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake @@ -6,8 +6,8 @@ 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_2 "main_component*-headers.rpm") + set(EXPECTED_FILE_2_COMPONENT "headers") set(EXPECTED_FILE_CONTENT_2 "^/usr/bar${whitespaces_}/usr/bar/CMakeLists.txt$") - set(EXPECTED_FILE_3 "main_component*-libs.rpm") + set(EXPECTED_FILE_3_COMPONENT "libs") set(EXPECTED_FILE_CONTENT_3 "^/usr/bas${whitespaces_}/usr/bas/CMakeLists.txt$") endif() diff --git a/Tests/RunCMake/CPack/tests/MINIMAL/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/MINIMAL/ExpectedFiles.cmake index 546b891..b707464 100644 --- a/Tests/RunCMake/CPack/tests/MINIMAL/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/MINIMAL/ExpectedFiles.cmake @@ -3,12 +3,9 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "1") if(GENERATOR_TYPE STREQUAL "DEB") - set(EXPECTED_FILE_1 "minimal_0.1.1-1_*.deb") set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/foo/${whitespaces_}.*/usr/foo/CMakeLists.txt$") elseif(GENERATOR_TYPE STREQUAL "RPM") - set(EXPECTED_FILE_1 "minimal*.rpm") set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") elseif(GENERATOR_TYPE STREQUAL "TGZ") - set(EXPECTED_FILE_1 "minimal*.tar.gz") set(EXPECTED_FILE_CONTENT_1 "^[^\n]*minimal-0.1.1-[^\n]*/foo/\n[^\n]*minimal-0.1.1-[^\n]*/foo/CMakeLists.txt$") endif() diff --git a/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake b/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake index 2182f46..4441c8e 100644 --- a/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake +++ b/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake @@ -1,6 +1,5 @@ if(GENERATOR_TYPE STREQUAL "DEB") set(CPACK_PACKAGE_CONTACT "someone") - set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") endif() install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) diff --git a/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake index 205dcd8..6a300e9 100644 --- a/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake @@ -4,6 +4,5 @@ set(EXPECTED_FILES_COUNT "0") if (NOT ${RunCMake_SUBTEST_SUFFIX} MATCHES "invalid") set(EXPECTED_FILES_COUNT "1") - set(EXPECTED_FILE_1 "package_checksum*.tar.gz") set(EXPECTED_FILE_CONTENT_1 "^[^\n]*package_checksum*-[^\n]*/foo/\n[^\n]*package_checksum-[^\n]*/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 ddaa9db..5c824d4 100644 --- a/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/ExpectedFiles.cmake @@ -1,5 +1,4 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "partially_relocatable_warning-0.1.1-*.rpm") set(EXPECTED_FILE_CONTENT_1 "^/not_relocatable${whitespaces_}/not_relocatable/CMakeLists.txt${whitespaces_}/opt$") diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake index 8ff725c..c2ed511 100644 --- a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake @@ -1,19 +1,17 @@ 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_2_NAME "second") +set(EXPECTED_FILE_3_COMPONENT "pkg_3") if(GENERATOR_TYPE STREQUAL "DEB") - set(EXPECTED_FILE_1 "per_component_fields-pkg_1_0.1.1-1_*.deb") set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_2 "second_0.1.1-1_*.deb") set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_3 "per_component_fields-pkg_3_0.1.1-1_*.deb") set(EXPECTED_FILE_CONTENT_3 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") elseif(GENERATOR_TYPE STREQUAL "RPM") - set(EXPECTED_FILE_1 "per_component_fields*-pkg_1.rpm") set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_2 "per_component_fields*-pkg_2.rpm") set(EXPECTED_FILE_CONTENT_2 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") - set(EXPECTED_FILE_3 "per_component_fields*-pkg_3.rpm") set(EXPECTED_FILE_CONTENT_3 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") endif() diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake index b042092..3fca2e2 100644 --- a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake +++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake @@ -8,6 +8,7 @@ if(GENERATOR_TYPE STREQUAL "DEB") set(CPACK_DEBIAN_PKG_2_PACKAGE_SECTION "second_group") elseif(GENERATOR_TYPE STREQUAL "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") + set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") set(CPACK_RPM_PACKAGE_GROUP "default") set(CPACK_RPM_PKG_2_PACKAGE_NAME "second") diff --git a/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake index 3b5a347..f227e1f 100644 --- a/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake @@ -1,5 +1,4 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "rpm_dist*.rpm") set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/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 02ebb44..f227e1f 100644 --- a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake @@ -1,5 +1,4 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "rpm_suggests*.rpm") set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/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 dc49343..9c0dea4 100644 --- a/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake @@ -1,6 +1,7 @@ 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") @@ -11,7 +12,7 @@ if(RunCMake_SUBTEST_SUFFIX STREQUAL "valid" OR RunCMake_SUBTEST_SUFFIX STREQUAL set(EXPECTED_FILE_3 "single_debuginfo*-libs.rpm") set(EXPECTED_FILE_CONTENT_3 "^/usr/bas${whitespaces_}/usr/bas/libtest_lib.so$") - set(EXPECTED_FILE_4 "single_debuginfo-debuginfo*.rpm") + 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") diff --git a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake index d6811eb..05ea102 100644 --- a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake @@ -1,5 +1,4 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_1 "source_package*.src.rpm") set(EXPECTED_FILE_CONTENT_1 "^source_package-0.1.1.tar.gz${whitespaces_}source_package.spec$") -- cgit v0.12 From b687d2ba093b1b79e9faf09e45d11567b0ec9ac1 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 27 Nov 2016 15:30:46 +0100 Subject: 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. --- Tests/RunCMake/CPack/DEB/Helpers.cmake | 21 ++++++++++++ Tests/RunCMake/CPack/RPM/Helpers.cmake | 33 +++++++++++++++++++ Tests/RunCMake/CPack/TGZ/Helpers.cmake | 38 ++++++++++++++++++++++ Tests/RunCMake/CPack/VerifyResult.cmake | 22 +++++++++++-- .../tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake | 10 ++---- .../CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake | 15 ++------- .../CPack/tests/DEBUGINFO/ExpectedFiles.cmake | 7 ++-- .../CPack/tests/DEB_EXTRA/ExpectedFiles.cmake | 8 ++--- .../CPack/tests/DEPENDENCIES/ExpectedFiles.cmake | 17 ++++------ .../CPack/tests/EMPTY_DIR/ExpectedFiles.cmake | 11 +------ .../tests/INSTALL_SCRIPTS/ExpectedFiles.cmake | 6 ++-- .../CPack/tests/LONG_FILENAMES/ExpectedFiles.cmake | 4 +-- .../CPack/tests/MAIN_COMPONENT/ExpectedFiles.cmake | 8 ++--- .../CPack/tests/MINIMAL/ExpectedFiles.cmake | 11 +------ .../tests/PACKAGE_CHECKSUM/ExpectedFiles.cmake | 6 ++-- .../ExpectedFiles.cmake | 4 +-- .../tests/PER_COMPONENT_FIELDS/ExpectedFiles.cmake | 15 ++------- .../CPack/tests/RPM_DIST/ExpectedFiles.cmake | 4 +-- .../CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake | 4 +-- .../tests/SINGLE_DEBUGINFO/ExpectedFiles.cmake | 11 +++---- .../CPack/tests/SOURCE_PACKAGE/ExpectedFiles.cmake | 4 +-- .../CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake | 2 ++ 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") -- cgit v0.12 From 181e9bb6128c9ad4043c41ef270c79318146e1ad Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 27 Nov 2016 15:33:17 +0100 Subject: Tests: CPack test long_filenames prerequirements Fakeroot executable is already searched for in DEB packager tests prerequirements so the test prerequirement just has to check that it is present in config file and not search for it once more. --- Tests/RunCMake/CPack/tests/LONG_FILENAMES/DEB-Prerequirements.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/DEB-Prerequirements.cmake index 0c1d77e..ddd16e5 100644 --- a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/DEB-Prerequirements.cmake +++ b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/DEB-Prerequirements.cmake @@ -1,5 +1,5 @@ -function(get_test_prerequirements found_var) - find_program(FAKEROOT_EXECUTABLE NAMES fakeroot) +function(get_test_prerequirements found_var config_file) + include(${config_file}) if(FAKEROOT_EXECUTABLE) set(${found_var} true PARENT_SCOPE) -- cgit v0.12 From 2cc479bdac84843d0284573cf801ee526e798c54 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 27 Nov 2016 16:02:53 +0100 Subject: Tests: remove generator prefix from CPack test name --- Tests/RunCMake/CPack/RunCMakeTest.cmake | 10 +++--- .../CPack/tests/DEB_EXTRA/ExpectedFiles.cmake | 8 ----- .../CPack/tests/DEB_EXTRA/VerifyResult.cmake | 18 ---------- Tests/RunCMake/CPack/tests/DEB_EXTRA/test.cmake | 38 ---------------------- .../DEB_GENERATE_SHLIBS/DEB-Prerequirements.cmake | 7 ---- .../tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake | 6 ---- .../tests/DEB_GENERATE_SHLIBS/VerifyResult.cmake | 4 --- .../CPack/tests/DEB_GENERATE_SHLIBS/test.cmake | 16 --------- .../DEB-Prerequirements.cmake | 7 ---- .../ExpectedFiles.cmake | 6 ---- .../VerifyResult.cmake | 8 ----- .../tests/DEB_GENERATE_SHLIBS_LDCONFIG/test.cmake | 17 ---------- .../RunCMake/CPack/tests/DIST/ExpectedFiles.cmake | 2 ++ Tests/RunCMake/CPack/tests/DIST/VerifyResult.cmake | 11 +++++++ Tests/RunCMake/CPack/tests/DIST/test.cmake | 3 ++ .../RunCMake/CPack/tests/EXTRA/ExpectedFiles.cmake | 8 +++++ .../RunCMake/CPack/tests/EXTRA/VerifyResult.cmake | 18 ++++++++++ Tests/RunCMake/CPack/tests/EXTRA/test.cmake | 38 ++++++++++++++++++++++ .../GENERATE_SHLIBS/DEB-Prerequirements.cmake | 7 ++++ .../tests/GENERATE_SHLIBS/ExpectedFiles.cmake | 6 ++++ .../CPack/tests/GENERATE_SHLIBS/VerifyResult.cmake | 4 +++ .../CPack/tests/GENERATE_SHLIBS/test.cmake | 16 +++++++++ .../DEB-Prerequirements.cmake | 7 ++++ .../GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake | 6 ++++ .../GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake | 8 +++++ .../tests/GENERATE_SHLIBS_LDCONFIG/test.cmake | 17 ++++++++++ .../CPack/tests/RPM_DIST/ExpectedFiles.cmake | 2 -- .../CPack/tests/RPM_DIST/VerifyResult.cmake | 11 ------- Tests/RunCMake/CPack/tests/RPM_DIST/test.cmake | 3 -- .../CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake | 2 -- .../CPack/tests/RPM_SUGGESTS/RPM-stderr.txt | 1 - .../CPack/tests/RPM_SUGGESTS/VerifyResult.cmake | 31 ------------------ Tests/RunCMake/CPack/tests/RPM_SUGGESTS/test.cmake | 3 -- .../CPack/tests/SUGGESTS/ExpectedFiles.cmake | 2 ++ Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt | 1 + .../CPack/tests/SUGGESTS/VerifyResult.cmake | 31 ++++++++++++++++++ Tests/RunCMake/CPack/tests/SUGGESTS/test.cmake | 3 ++ 37 files changed, 193 insertions(+), 193 deletions(-) delete mode 100644 Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/tests/DEB_EXTRA/VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/tests/DEB_EXTRA/test.cmake delete mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/DEB-Prerequirements.cmake delete mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/test.cmake delete mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake delete mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/DIST/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/DIST/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/DIST/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/EXTRA/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/EXTRA/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/EXTRA/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake create mode 100644 Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake create mode 100644 Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/test.cmake delete mode 100644 Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/tests/RPM_DIST/VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/tests/RPM_DIST/test.cmake delete mode 100644 Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/tests/RPM_SUGGESTS/RPM-stderr.txt delete mode 100644 Tests/RunCMake/CPack/tests/RPM_SUGGESTS/VerifyResult.cmake delete mode 100644 Tests/RunCMake/CPack/tests/RPM_SUGGESTS/test.cmake create mode 100644 Tests/RunCMake/CPack/tests/SUGGESTS/ExpectedFiles.cmake create mode 100644 Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt create mode 100644 Tests/RunCMake/CPack/tests/SUGGESTS/VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/tests/SUGGESTS/test.cmake diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 61d4332..39896ba 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -7,18 +7,18 @@ include("${RunCMake_SOURCE_DIR}/CPackTestHelpers.cmake") run_cpack_test(MINIMAL "RPM;DEB;TGZ" false) run_cpack_source_test(SOURCE_PACKAGE "RPM" true) run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM" false) -run_cpack_test(DEB_EXTRA "DEB" false) +run_cpack_test(EXTRA "DEB" false) run_cpack_test(DEPENDENCIES "RPM;DEB" true) run_cpack_test(EMPTY_DIR "RPM;DEB;TGZ" true) run_cpack_test(COMPONENTS_EMPTY_DIR "RPM;DEB;TGZ" true) run_cpack_test(CUSTOM_NAMES "RPM;DEB" true) run_cpack_test_subtests(MAIN_COMPONENT "invalid;found" "RPM" false) run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false) -run_cpack_test(RPM_DIST "RPM" false) -run_cpack_test(RPM_SUGGESTS "RPM" false) +run_cpack_test(DIST "RPM" false) +run_cpack_test(SUGGESTS "RPM" false) run_cpack_test(INSTALL_SCRIPTS "RPM" false) -run_cpack_test(DEB_GENERATE_SHLIBS "DEB" true) -run_cpack_test(DEB_GENERATE_SHLIBS_LDCONFIG "DEB" true) +run_cpack_test(GENERATE_SHLIBS "DEB" true) +run_cpack_test(GENERATE_SHLIBS_LDCONFIG "DEB" true) run_cpack_test(DEBUGINFO "RPM" true) run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component;one_component;one_component_main;no_debuginfo;one_component_no_debuginfo;no_components;valid" "RPM" true) run_cpack_test(LONG_FILENAMES "DEB" false) diff --git a/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake deleted file mode 100644 index ded2923..0000000 --- a/Tests/RunCMake/CPack/tests/DEB_EXTRA/ExpectedFiles.cmake +++ /dev/null @@ -1,8 +0,0 @@ -set(EXPECTED_FILES_COUNT "3") -set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) -set(EXPECTED_FILE_1_COMPONENT "foo") -set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") -set(EXPECTED_FILE_2_COMPONENT "bar") -set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/bar;/usr/bar/CMakeLists.txt") -set(EXPECTED_FILE_3_COMPONENT "bas") -set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/bas;/usr/bas/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/DEB_EXTRA/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DEB_EXTRA/VerifyResult.cmake deleted file mode 100644 index 85e137f..0000000 --- a/Tests/RunCMake/CPack/tests/DEB_EXTRA/VerifyResult.cmake +++ /dev/null @@ -1,18 +0,0 @@ -set(foo_preinst "^echo default_preinst$") -# NOTE: optional dot at the end of permissions regex is for SELinux enabled systems -set(foo_preinst_permissions_regex "-rwxr-xr-x\.? .*") -set(foo_prerm "^echo default_prerm$") -set(foo_prerm_permissions_regex "-rwxr-xr-x\.? .*") -verifyDebControl("${FOUND_FILE_1}" "foo" "preinst;prerm") - -set(bar_preinst "^echo bar_preinst$") -set(bar_preinst_permissions_regex "-rwx------\.? .*") -set(bar_prerm "^echo bar_prerm$") -set(bar_prerm_permissions_regex "-rwx------\.? .*") -verifyDebControl("${FOUND_FILE_2}" "bar" "preinst;prerm") - -set(bas_preinst "^echo default_preinst$") -set(bas_preinst_permissions_regex "-rwxr-xr-x\.? .*") -set(bas_prerm "^echo default_prerm$") -set(bas_prerm_permissions_regex "-rwxr-xr-x\.? .*") -verifyDebControl("${FOUND_FILE_3}" "bas" "preinst;prerm") diff --git a/Tests/RunCMake/CPack/tests/DEB_EXTRA/test.cmake b/Tests/RunCMake/CPack/tests/DEB_EXTRA/test.cmake deleted file mode 100644 index 754561d..0000000 --- a/Tests/RunCMake/CPack/tests/DEB_EXTRA/test.cmake +++ /dev/null @@ -1,38 +0,0 @@ -install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo) -install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar) -install(FILES CMakeLists.txt DESTINATION bas COMPONENT bas) - -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/preinst "echo default_preinst") -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/prerm "echo default_prerm") - -foreach(file_ preinst prerm) - file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/${file_} - DESTINATION ${CMAKE_CURRENT_BINARY_DIR} - FILE_PERMISSIONS - OWNER_READ OWNER_WRITE OWNER_EXECUTE - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE) -endforeach() - -set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA - "${CMAKE_CURRENT_BINARY_DIR}/preinst;${CMAKE_CURRENT_BINARY_DIR}/prerm;${CMAKE_CURRENT_BINARY_DIR}/conffiles") - -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/preinst "echo bar_preinst") -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/prerm "echo bar_prerm") - -foreach(file_ preinst prerm) - # not acceptable permissions for lintian but we need to check that - # permissions are preserved - file(COPY ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/${file_} - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bar - FILE_PERMISSIONS - OWNER_READ OWNER_WRITE OWNER_EXECUTE) -endforeach() - -set(CPACK_DEBIAN_BAR_PACKAGE_CONTROL_EXTRA - "${CMAKE_CURRENT_BINARY_DIR}/bar/preinst;${CMAKE_CURRENT_BINARY_DIR}/bar/prerm") - -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - -set(CPACK_DEB_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/DEB-Prerequirements.cmake deleted file mode 100644 index b98065a..0000000 --- a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/DEB-Prerequirements.cmake +++ /dev/null @@ -1,7 +0,0 @@ -function(get_test_prerequirements found_var) - find_program(READELF_EXECUTABLE NAMES readelf) - - if(READELF_EXECUTABLE) - set(${found_var} true PARENT_SCOPE) - endif() -endfunction() diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake deleted file mode 100644 index ccb5ef0..0000000 --- a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/ExpectedFiles.cmake +++ /dev/null @@ -1,6 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) -# dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/VerifyResult.cmake deleted file mode 100644 index f5d97db..0000000 --- a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/VerifyResult.cmake +++ /dev/null @@ -1,4 +0,0 @@ -set(shlibs_shlibs "^libtest_lib 0\\.8 deb_generate_shlibs \\(\\= 0\\.1\\.1\\)\n$") -# optional dot at the end of permissions regex is for SELinux enabled systems -set(shlibs_shlibs_permissions_regex "-rw-r--r--\.? .*") -verifyDebControl("${FOUND_FILE_1}" "shlibs" "shlibs") diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/test.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/test.cmake deleted file mode 100644 index fa0bc35..0000000 --- a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS/test.cmake +++ /dev/null @@ -1,16 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") -set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - -set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") - -set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" - "int test_lib();\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" - "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") -add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") -set_target_properties(test_lib PROPERTIES SOVERSION "0.8") - -install(TARGETS test_lib DESTINATION foo COMPONENT libs) diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake deleted file mode 100644 index b98065a..0000000 --- a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake +++ /dev/null @@ -1,7 +0,0 @@ -function(get_test_prerequirements found_var) - find_program(READELF_EXECUTABLE NAMES readelf) - - if(READELF_EXECUTABLE) - set(${found_var} true PARENT_SCOPE) - endif() -endfunction() diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake deleted file mode 100644 index d66c044..0000000 --- a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake +++ /dev/null @@ -1,6 +0,0 @@ -set(whitespaces_ "[\t\n\r ]*") - -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) -# dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it -set(EXPECTED_FILE_CONTENT_1 "^.*/usr/lib${whitespaces_}.*/usr/lib/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake deleted file mode 100644 index 320732b..0000000 --- a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake +++ /dev/null @@ -1,8 +0,0 @@ -set(shlibs_shlibs "^libtest_lib 0\\.8 deb_generate_shlibs_ldconfig \\(>\\= 0\\.1\\.1\\)\n$") -# NOTE: optional dot at the end of permissions regex is for SELinux enabled systems -set(shlibs_shlibs_permissions_regex "-rw-r--r--\.? .*") -set(shlibs_postinst ".*ldconfig.*") -set(shlibs_postinst_permissions_regex "-rwxr-xr-x\.? .*") -set(shlibs_postrm ".*ldconfig.*") -set(shlibs_postrm_permissions_regex "-rwxr-xr-x\.? .*") -verifyDebControl("${FOUND_FILE_1}" "shlibs" "shlibs;postinst;postrm") diff --git a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/test.cmake b/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/test.cmake deleted file mode 100644 index 2fc9e23..0000000 --- a/Tests/RunCMake/CPack/tests/DEB_GENERATE_SHLIBS_LDCONFIG/test.cmake +++ /dev/null @@ -1,17 +0,0 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") -set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - -set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") -set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=") - -set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" - "int test_lib();\n") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" - "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") -add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") -set_target_properties(test_lib PROPERTIES SOVERSION "0.8") - -install(TARGETS test_lib LIBRARY DESTINATION lib COMPONENT libs NAMELINK_SKIP) diff --git a/Tests/RunCMake/CPack/tests/DIST/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DIST/ExpectedFiles.cmake new file mode 100644 index 0000000..6142eb3 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DIST/ExpectedFiles.cmake @@ -0,0 +1,2 @@ +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/DIST/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DIST/VerifyResult.cmake new file mode 100644 index 0000000..7375ecc --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DIST/VerifyResult.cmake @@ -0,0 +1,11 @@ +execute_process(COMMAND ${RPMBUILD_EXECUTABLE} -E %{?dist} + OUTPUT_VARIABLE DIST_TAG + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + +set(whitespaces_ "[\t\n\r ]*") + +getPackageInfo("${FOUND_FILE_1}" "FILE_INFO_") +if(NOT FILE_INFO_ MATCHES ".*Release${whitespaces_}:${whitespaces_}1${DIST_TAG}") + message(FATAL_ERROR "Unexpected Release in '${FOUND_FILE_1}'; file info: '${FILE_INFO_}'") +endif() diff --git a/Tests/RunCMake/CPack/tests/DIST/test.cmake b/Tests/RunCMake/CPack/tests/DIST/test.cmake new file mode 100644 index 0000000..6bdd2c0 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DIST/test.cmake @@ -0,0 +1,3 @@ +install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) + +set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) diff --git a/Tests/RunCMake/CPack/tests/EXTRA/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/EXTRA/ExpectedFiles.cmake new file mode 100644 index 0000000..ded2923 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTRA/ExpectedFiles.cmake @@ -0,0 +1,8 @@ +set(EXPECTED_FILES_COUNT "3") +set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) +set(EXPECTED_FILE_1_COMPONENT "foo") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") +set(EXPECTED_FILE_2_COMPONENT "bar") +set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/bar;/usr/bar/CMakeLists.txt") +set(EXPECTED_FILE_3_COMPONENT "bas") +set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/bas;/usr/bas/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/EXTRA/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/EXTRA/VerifyResult.cmake new file mode 100644 index 0000000..85e137f --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTRA/VerifyResult.cmake @@ -0,0 +1,18 @@ +set(foo_preinst "^echo default_preinst$") +# NOTE: optional dot at the end of permissions regex is for SELinux enabled systems +set(foo_preinst_permissions_regex "-rwxr-xr-x\.? .*") +set(foo_prerm "^echo default_prerm$") +set(foo_prerm_permissions_regex "-rwxr-xr-x\.? .*") +verifyDebControl("${FOUND_FILE_1}" "foo" "preinst;prerm") + +set(bar_preinst "^echo bar_preinst$") +set(bar_preinst_permissions_regex "-rwx------\.? .*") +set(bar_prerm "^echo bar_prerm$") +set(bar_prerm_permissions_regex "-rwx------\.? .*") +verifyDebControl("${FOUND_FILE_2}" "bar" "preinst;prerm") + +set(bas_preinst "^echo default_preinst$") +set(bas_preinst_permissions_regex "-rwxr-xr-x\.? .*") +set(bas_prerm "^echo default_prerm$") +set(bas_prerm_permissions_regex "-rwxr-xr-x\.? .*") +verifyDebControl("${FOUND_FILE_3}" "bas" "preinst;prerm") diff --git a/Tests/RunCMake/CPack/tests/EXTRA/test.cmake b/Tests/RunCMake/CPack/tests/EXTRA/test.cmake new file mode 100644 index 0000000..754561d --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTRA/test.cmake @@ -0,0 +1,38 @@ +install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo) +install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar) +install(FILES CMakeLists.txt DESTINATION bas COMPONENT bas) + +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/preinst "echo default_preinst") +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/prerm "echo default_prerm") + +foreach(file_ preinst prerm) + file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/${file_} + DESTINATION ${CMAKE_CURRENT_BINARY_DIR} + FILE_PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) +endforeach() + +set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA + "${CMAKE_CURRENT_BINARY_DIR}/preinst;${CMAKE_CURRENT_BINARY_DIR}/prerm;${CMAKE_CURRENT_BINARY_DIR}/conffiles") + +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/preinst "echo bar_preinst") +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/prerm "echo bar_prerm") + +foreach(file_ preinst prerm) + # not acceptable permissions for lintian but we need to check that + # permissions are preserved + file(COPY ${CMAKE_CURRENT_BINARY_DIR}/bar_tmp/${file_} + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bar + FILE_PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE) +endforeach() + +set(CPACK_DEBIAN_BAR_PACKAGE_CONTROL_EXTRA + "${CMAKE_CURRENT_BINARY_DIR}/bar/preinst;${CMAKE_CURRENT_BINARY_DIR}/bar/prerm") + +set(CPACK_PACKAGE_CONTACT "someone") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") + +set(CPACK_DEB_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake new file mode 100644 index 0000000..b98065a --- /dev/null +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake @@ -0,0 +1,7 @@ +function(get_test_prerequirements found_var) + find_program(READELF_EXECUTABLE NAMES readelf) + + if(READELF_EXECUTABLE) + set(${found_var} true PARENT_SCOPE) + endif() +endfunction() diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/ExpectedFiles.cmake new file mode 100644 index 0000000..ccb5ef0 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/ExpectedFiles.cmake @@ -0,0 +1,6 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) +# dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it +set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/VerifyResult.cmake new file mode 100644 index 0000000..b1952ef --- /dev/null +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/VerifyResult.cmake @@ -0,0 +1,4 @@ +set(shlibs_shlibs "^libtest_lib 0\\.8 generate_shlibs \\(\\= 0\\.1\\.1\\)\n$") +# optional dot at the end of permissions regex is for SELinux enabled systems +set(shlibs_shlibs_permissions_regex "-rw-r--r--\.? .*") +verifyDebControl("${FOUND_FILE_1}" "shlibs" "shlibs") diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/test.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/test.cmake new file mode 100644 index 0000000..fa0bc35 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/test.cmake @@ -0,0 +1,16 @@ +set(CPACK_PACKAGE_CONTACT "someone") +set(CPACK_DEB_COMPONENT_INSTALL "ON") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") + +set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") + +set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" + "int test_lib();\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" + "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") +add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") +set_target_properties(test_lib PROPERTIES SOVERSION "0.8") + +install(TARGETS test_lib DESTINATION foo COMPONENT libs) diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake new file mode 100644 index 0000000..b98065a --- /dev/null +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake @@ -0,0 +1,7 @@ +function(get_test_prerequirements found_var) + find_program(READELF_EXECUTABLE NAMES readelf) + + if(READELF_EXECUTABLE) + set(${found_var} true PARENT_SCOPE) + endif() +endfunction() diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake new file mode 100644 index 0000000..d66c044 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/ExpectedFiles.cmake @@ -0,0 +1,6 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) +# dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it +set(EXPECTED_FILE_CONTENT_1 "^.*/usr/lib${whitespaces_}.*/usr/lib/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake new file mode 100644 index 0000000..422cfbe --- /dev/null +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake @@ -0,0 +1,8 @@ +set(shlibs_shlibs "^libtest_lib 0\\.8 generate_shlibs_ldconfig \\(>\\= 0\\.1\\.1\\)\n$") +# NOTE: optional dot at the end of permissions regex is for SELinux enabled systems +set(shlibs_shlibs_permissions_regex "-rw-r--r--\.? .*") +set(shlibs_postinst ".*ldconfig.*") +set(shlibs_postinst_permissions_regex "-rwxr-xr-x\.? .*") +set(shlibs_postrm ".*ldconfig.*") +set(shlibs_postrm_permissions_regex "-rwxr-xr-x\.? .*") +verifyDebControl("${FOUND_FILE_1}" "shlibs" "shlibs;postinst;postrm") diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/test.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/test.cmake new file mode 100644 index 0000000..2fc9e23 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/test.cmake @@ -0,0 +1,17 @@ +set(CPACK_PACKAGE_CONTACT "someone") +set(CPACK_DEB_COMPONENT_INSTALL "ON") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") + +set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") +set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=") + +set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" + "int test_lib();\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp" + "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n") +add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp") +set_target_properties(test_lib PROPERTIES SOVERSION "0.8") + +install(TARGETS test_lib LIBRARY DESTINATION lib COMPONENT libs NAMELINK_SKIP) diff --git a/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake deleted file mode 100644 index 6142eb3..0000000 --- a/Tests/RunCMake/CPack/tests/RPM_DIST/ExpectedFiles.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/RPM_DIST/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/RPM_DIST/VerifyResult.cmake deleted file mode 100644 index 7375ecc..0000000 --- a/Tests/RunCMake/CPack/tests/RPM_DIST/VerifyResult.cmake +++ /dev/null @@ -1,11 +0,0 @@ -execute_process(COMMAND ${RPMBUILD_EXECUTABLE} -E %{?dist} - OUTPUT_VARIABLE DIST_TAG - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - -set(whitespaces_ "[\t\n\r ]*") - -getPackageInfo("${FOUND_FILE_1}" "FILE_INFO_") -if(NOT FILE_INFO_ MATCHES ".*Release${whitespaces_}:${whitespaces_}1${DIST_TAG}") - message(FATAL_ERROR "Unexpected Release in '${FOUND_FILE_1}'; file info: '${FILE_INFO_}'") -endif() diff --git a/Tests/RunCMake/CPack/tests/RPM_DIST/test.cmake b/Tests/RunCMake/CPack/tests/RPM_DIST/test.cmake deleted file mode 100644 index 6bdd2c0..0000000 --- a/Tests/RunCMake/CPack/tests/RPM_DIST/test.cmake +++ /dev/null @@ -1,3 +0,0 @@ -install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) - -set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) diff --git a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake deleted file mode 100644 index 6142eb3..0000000 --- a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/ExpectedFiles.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/RPM-stderr.txt b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/RPM-stderr.txt deleted file mode 100644 index feb296c..0000000 --- a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/RPM-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^(.*CPackRPM:Warning: SUGGESTS not supported in provided rpmbuild.*)?CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM/CPack/[^-]*-build/_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec$ diff --git a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/VerifyResult.cmake deleted file mode 100644 index 32cc6d1..0000000 --- a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/VerifyResult.cmake +++ /dev/null @@ -1,31 +0,0 @@ -execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --querytags - OUTPUT_VARIABLE RPMBUILD_CAPS - RESULT_VARIABLE RPMBUILD_CAPS_RESULT) - -if(NOT RPMBUILD_CAPS_RESULT) - string(REPLACE "\n" ";" RPMBUILD_CAPS "${RPMBUILD_CAPS}") - cmake_policy(PUSH) - cmake_policy(SET CMP0057 NEW) - if(SUGGESTS IN_LIST RPMBUILD_CAPS) - set(should_contain_suggests_tag_ true) - endif() - cmake_policy(POP) -endif() - -# Only verify that suggests tag is present only if that tag is supported. -# If it is not supported the rpm package was corretly generated by ignoring -# that tag and that was already checked by expected files test. -if(should_contain_suggests_tag_) - execute_process(COMMAND ${RPM_EXECUTABLE} -q --suggests -p "${FOUND_FILE_1}" - WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" - RESULT_VARIABLE rpm_result_ - OUTPUT_VARIABLE rpm_output_ - ERROR_VARIABLE error_variable_ - OUTPUT_STRIP_TRAILING_WHITESPACE) - - if(rpm_result_ OR NOT rpm_output_ STREQUAL "libsuggested") - message(FATAL_ERROR "RPM_SUGGESTED package error: no suggested packages" - " (result: '${rpm_result_}'; output: '${rpm_output_}';" - " error: '${error_variable_}')") - endif() -endif() diff --git a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/test.cmake b/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/test.cmake deleted file mode 100644 index dc90ae8..0000000 --- a/Tests/RunCMake/CPack/tests/RPM_SUGGESTS/test.cmake +++ /dev/null @@ -1,3 +0,0 @@ -install(FILES CMakeLists.txt DESTINATION foo) - -set(CPACK_RPM_PACKAGE_SUGGESTS "libsuggested") diff --git a/Tests/RunCMake/CPack/tests/SUGGESTS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/SUGGESTS/ExpectedFiles.cmake new file mode 100644 index 0000000..6142eb3 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SUGGESTS/ExpectedFiles.cmake @@ -0,0 +1,2 @@ +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt b/Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt new file mode 100644 index 0000000..feb296c --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt @@ -0,0 +1 @@ +^(.*CPackRPM:Warning: SUGGESTS not supported in provided rpmbuild.*)?CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM/CPack/[^-]*-build/_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec$ diff --git a/Tests/RunCMake/CPack/tests/SUGGESTS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/SUGGESTS/VerifyResult.cmake new file mode 100644 index 0000000..32cc6d1 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SUGGESTS/VerifyResult.cmake @@ -0,0 +1,31 @@ +execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --querytags + OUTPUT_VARIABLE RPMBUILD_CAPS + RESULT_VARIABLE RPMBUILD_CAPS_RESULT) + +if(NOT RPMBUILD_CAPS_RESULT) + string(REPLACE "\n" ";" RPMBUILD_CAPS "${RPMBUILD_CAPS}") + cmake_policy(PUSH) + cmake_policy(SET CMP0057 NEW) + if(SUGGESTS IN_LIST RPMBUILD_CAPS) + set(should_contain_suggests_tag_ true) + endif() + cmake_policy(POP) +endif() + +# Only verify that suggests tag is present only if that tag is supported. +# If it is not supported the rpm package was corretly generated by ignoring +# that tag and that was already checked by expected files test. +if(should_contain_suggests_tag_) + execute_process(COMMAND ${RPM_EXECUTABLE} -q --suggests -p "${FOUND_FILE_1}" + WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" + RESULT_VARIABLE rpm_result_ + OUTPUT_VARIABLE rpm_output_ + ERROR_VARIABLE error_variable_ + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(rpm_result_ OR NOT rpm_output_ STREQUAL "libsuggested") + message(FATAL_ERROR "RPM_SUGGESTED package error: no suggested packages" + " (result: '${rpm_result_}'; output: '${rpm_output_}';" + " error: '${error_variable_}')") + endif() +endif() diff --git a/Tests/RunCMake/CPack/tests/SUGGESTS/test.cmake b/Tests/RunCMake/CPack/tests/SUGGESTS/test.cmake new file mode 100644 index 0000000..dc90ae8 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/SUGGESTS/test.cmake @@ -0,0 +1,3 @@ +install(FILES CMakeLists.txt DESTINATION foo) + +set(CPACK_RPM_PACKAGE_SUGGESTS "libsuggested") -- cgit v0.12 From d040d1647d2192ab97db9b041599c9e224c93553 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 27 Nov 2016 16:33:13 +0100 Subject: Tests: CPack test set packaging type CPack tests can now define one or more packaging types and that test will be executed once per generator per packaging type. This also enables us to set default values per packaging type for each generator which makes tests shorter. --- Tests/RunCMake/CPack/CMakeLists.txt | 6 ++ Tests/RunCMake/CPack/CPackTestHelpers.cmake | 30 +++++--- .../CPack/DEB/packaging_COMPONENT_default.cmake | 2 + .../CPack/DEB/packaging_MONOLITHIC_default.cmake | 1 + .../CPack/RPM/packaging_COMPONENT_default.cmake | 1 + Tests/RunCMake/CPack/RunCMakeTest.cmake | 37 +++++---- Tests/RunCMake/CPack/TGZ/Helpers.cmake | 14 +++- .../CPack/TGZ/packaging_COMPONENT_default.cmake | 1 + .../tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake | 9 --- .../CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake | 14 ---- Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake | 20 ++--- Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake | 2 - .../CPack/tests/DEPENDENCIES/VerifyResult.cmake | 10 +-- Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake | 87 ++++++++++------------ .../CPack/tests/EMPTY_DIR/ExpectedFiles.cmake | 4 + Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake | 8 +- Tests/RunCMake/CPack/tests/EXTRA/test.cmake | 3 - .../CPack/tests/GENERATE_SHLIBS/test.cmake | 2 - .../tests/GENERATE_SHLIBS_LDCONFIG/test.cmake | 2 - .../CPack/tests/INSTALL_SCRIPTS/test.cmake | 2 - .../RunCMake/CPack/tests/LONG_FILENAMES/test.cmake | 1 - .../RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake | 2 - Tests/RunCMake/CPack/tests/MINIMAL/test.cmake | 4 - .../tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake | 2 - .../CPack/tests/PER_COMPONENT_FIELDS/test.cmake | 24 +++--- 25 files changed, 130 insertions(+), 158 deletions(-) create mode 100644 Tests/RunCMake/CPack/DEB/packaging_COMPONENT_default.cmake create mode 100644 Tests/RunCMake/CPack/DEB/packaging_MONOLITHIC_default.cmake create mode 100644 Tests/RunCMake/CPack/RPM/packaging_COMPONENT_default.cmake create mode 100644 Tests/RunCMake/CPack/TGZ/packaging_COMPONENT_default.cmake delete mode 100644 Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake delete mode 100644 Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake diff --git a/Tests/RunCMake/CPack/CMakeLists.txt b/Tests/RunCMake/CPack/CMakeLists.txt index e06fa1c..c361af0 100644 --- a/Tests/RunCMake/CPack/CMakeLists.txt +++ b/Tests/RunCMake/CPack/CMakeLists.txt @@ -1,7 +1,13 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) +set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "") + project(${RunCMake_TEST} CXX) +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${GENERATOR_TYPE}/packaging_${PACKAGING_TYPE}_default.cmake") + include(${GENERATOR_TYPE}/packaging_${PACKAGING_TYPE}_default.cmake) +endif() + # set default test name (can be overwritten in test.cmake or specifics.cmake) string(TOLOWER "${RunCMake_TEST_FILE_PREFIX}" CPACK_PACKAGE_NAME) diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake index 3d80cc6..7e21d22 100644 --- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake +++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake @@ -1,6 +1,6 @@ cmake_policy(SET CMP0057 NEW) -function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source) +function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACKAGING_TYPE) if(TEST_TYPE IN_LIST types) set(RunCMake_TEST_NO_CLEAN TRUE) set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${TEST_NAME}-build") @@ -11,6 +11,8 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source) set(full_test_name_ "${full_test_name_}-${SUBTEST_SUFFIX}-subtest") endif() + string(APPEND full_test_name_ "-${PACKAGING_TYPE}-type") + # TODO this should be executed only once per ctest run (not per generator) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") @@ -31,7 +33,8 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source) # execute cmake set(RunCMake_TEST_OPTIONS "-DGENERATOR_TYPE=${TEST_TYPE}" "-DRunCMake_TEST_FILE_PREFIX=${TEST_NAME}" - "-DRunCMake_SUBTEST_SUFFIX=${SUBTEST_SUFFIX}") + "-DRunCMake_SUBTEST_SUFFIX=${SUBTEST_SUFFIX}" + "-DPACKAGING_TYPE=${PACKAGING_TYPE}") run_cmake(${full_test_name_}) # execute optional build step @@ -42,7 +45,7 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source) if(source) set(pack_params_ -G ${TEST_TYPE} --config ./CPackSourceConfig.cmake) FILE(APPEND ${RunCMake_TEST_BINARY_DIR}/CPackSourceConfig.cmake - "\nset(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS \"-DRunCMake_TEST:STRING=${full_test_name_}\ -DRunCMake_TEST_FILE_PREFIX:STRING=${TEST_NAME} -DGENERATOR_TYPE=${TEST_TYPE}\")") + "\nset(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS \"-DRunCMake_TEST:STRING=${full_test_name_} -DRunCMake_TEST_FILE_PREFIX:STRING=${TEST_NAME} -DGENERATOR_TYPE:STRING=${TEST_TYPE}\")") else() unset(pack_params_) endif() @@ -74,6 +77,7 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source) -DRunCMake_TEST_FILE_PREFIX=${TEST_NAME} -DRunCMake_SUBTEST_SUFFIX=${SUBTEST_SUFFIX} -DGENERATOR_TYPE=${TEST_TYPE} + -DPACKAGING_TYPE=${PACKAGING_TYPE} "-Dsrc_dir=${RunCMake_SOURCE_DIR}" "-Dbin_dir=${RunCMake_TEST_BINARY_DIR}" "-Dconfig_file=${config_file}" @@ -82,16 +86,20 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source) endif() endfunction() -function(run_cpack_test TEST_NAME types build) - run_cpack_test_common_("${TEST_NAME}" "${types}" "${build}" "" false) -endfunction() - -function(run_cpack_source_test TEST_NAME types build) - run_cpack_test_common_("${TEST_NAME}" "${types}" "${build}" "" true) +function(run_cpack_test TEST_NAME types build PACKAGING_TYPES) + foreach(packaging_type_ IN LISTS PACKAGING_TYPES) + run_cpack_test_common_("${TEST_NAME}" "${types}" "${build}" "" false "${packaging_type_}") + endforeach() endfunction() -function(run_cpack_test_subtests TEST_NAME SUBTEST_SUFFIXES types build) +function(run_cpack_test_subtests TEST_NAME SUBTEST_SUFFIXES types build PACKAGING_TYPES) foreach(suffix_ IN LISTS SUBTEST_SUFFIXES) - run_cpack_test_common_("${TEST_NAME}" "${types}" "${build}" "${suffix_}" false) + foreach(packaging_type_ IN LISTS PACKAGING_TYPES) + run_cpack_test_common_("${TEST_NAME}" "${types}" "${build}" "${suffix_}" false "${packaging_type_}") + endforeach() endforeach() endfunction() + +function(run_cpack_source_test TEST_NAME types build) + run_cpack_test_common_("${TEST_NAME}" "${types}" "${build}" "" true "") +endfunction() diff --git a/Tests/RunCMake/CPack/DEB/packaging_COMPONENT_default.cmake b/Tests/RunCMake/CPack/DEB/packaging_COMPONENT_default.cmake new file mode 100644 index 0000000..4219b0c --- /dev/null +++ b/Tests/RunCMake/CPack/DEB/packaging_COMPONENT_default.cmake @@ -0,0 +1,2 @@ +set(CPACK_DEB_COMPONENT_INSTALL "ON") +set(CPACK_PACKAGE_CONTACT "someone") diff --git a/Tests/RunCMake/CPack/DEB/packaging_MONOLITHIC_default.cmake b/Tests/RunCMake/CPack/DEB/packaging_MONOLITHIC_default.cmake new file mode 100644 index 0000000..8821ab9 --- /dev/null +++ b/Tests/RunCMake/CPack/DEB/packaging_MONOLITHIC_default.cmake @@ -0,0 +1 @@ +set(CPACK_PACKAGE_CONTACT "someone") diff --git a/Tests/RunCMake/CPack/RPM/packaging_COMPONENT_default.cmake b/Tests/RunCMake/CPack/RPM/packaging_COMPONENT_default.cmake new file mode 100644 index 0000000..c8b93e9 --- /dev/null +++ b/Tests/RunCMake/CPack/RPM/packaging_COMPONENT_default.cmake @@ -0,0 +1 @@ +set(CPACK_RPM_COMPONENT_INSTALL "ON") diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 39896ba..fa966c6 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -3,23 +3,22 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) include(RunCMake) include("${RunCMake_SOURCE_DIR}/CPackTestHelpers.cmake") -# args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP -run_cpack_test(MINIMAL "RPM;DEB;TGZ" false) +# run_cpack_test args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP "PACKAGING_TYPES" +run_cpack_test(CUSTOM_NAMES "RPM;DEB" true "COMPONENT") +run_cpack_test(DEBUGINFO "RPM" true "COMPONENT") +run_cpack_test(DEPENDENCIES "RPM;DEB" true "COMPONENT") +run_cpack_test(DIST "RPM" false "MONOLITHIC") +run_cpack_test(EMPTY_DIR "RPM;DEB;TGZ" true "MONOLITHIC;COMPONENT") +run_cpack_test(EXTRA "DEB" false "COMPONENT") +run_cpack_test(GENERATE_SHLIBS "DEB" true "COMPONENT") +run_cpack_test(GENERATE_SHLIBS_LDCONFIG "DEB" true "COMPONENT") +run_cpack_test(INSTALL_SCRIPTS "RPM" false "COMPONENT") +run_cpack_test(LONG_FILENAMES "DEB" false "MONOLITHIC") +run_cpack_test_subtests(MAIN_COMPONENT "invalid;found" "RPM" false "COMPONENT") +run_cpack_test(MINIMAL "RPM;DEB;TGZ" false "MONOLITHIC") +run_cpack_test_subtests(PACKAGE_CHECKSUM "invalid;MD5;SHA1;SHA224;SHA256;SHA384;SHA512" "TGZ" false "MONOLITHIC") +run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM" false "COMPONENT") +run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false "COMPONENT") +run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component;one_component;one_component_main;no_debuginfo;one_component_no_debuginfo;no_components;valid" "RPM" true "CUSTOM") run_cpack_source_test(SOURCE_PACKAGE "RPM" true) -run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM" false) -run_cpack_test(EXTRA "DEB" false) -run_cpack_test(DEPENDENCIES "RPM;DEB" true) -run_cpack_test(EMPTY_DIR "RPM;DEB;TGZ" true) -run_cpack_test(COMPONENTS_EMPTY_DIR "RPM;DEB;TGZ" true) -run_cpack_test(CUSTOM_NAMES "RPM;DEB" true) -run_cpack_test_subtests(MAIN_COMPONENT "invalid;found" "RPM" false) -run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false) -run_cpack_test(DIST "RPM" false) -run_cpack_test(SUGGESTS "RPM" false) -run_cpack_test(INSTALL_SCRIPTS "RPM" false) -run_cpack_test(GENERATE_SHLIBS "DEB" true) -run_cpack_test(GENERATE_SHLIBS_LDCONFIG "DEB" true) -run_cpack_test(DEBUGINFO "RPM" true) -run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component;one_component;one_component_main;no_debuginfo;one_component_no_debuginfo;no_components;valid" "RPM" true) -run_cpack_test(LONG_FILENAMES "DEB" false) -run_cpack_test_subtests(PACKAGE_CHECKSUM "invalid;MD5;SHA1;SHA224;SHA256;SHA384;SHA512;SHA3_224;SHA3_256;SHA3_384;SHA3_512" "TGZ" false) +run_cpack_test(SUGGESTS "RPM" false "MONOLITHIC") diff --git a/Tests/RunCMake/CPack/TGZ/Helpers.cmake b/Tests/RunCMake/CPack/TGZ/Helpers.cmake index 8715258..4a194c6 100644 --- a/Tests/RunCMake/CPack/TGZ/Helpers.cmake +++ b/Tests/RunCMake/CPack/TGZ/Helpers.cmake @@ -35,9 +35,15 @@ 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_}") + # component and monolithic packages differ for some reason by either having + # package filename prefix in path or not + if(PACKAGING_TYPE STREQUAL "MONOLITHIC") + get_filename_component(prefix_ "${file_}" NAME) + # NAME_WE removes everything after the dot and dot is in version so replace instead + string(REPLACE ".tar.gz" "/" prefix_ "${prefix_}") + else() + unset(prefix_) + endif() if(NOT DEFINED TEST_MAIN_INSTALL_PREFIX_PATH) set(TEST_MAIN_INSTALL_PREFIX_PATH "/usr") @@ -45,7 +51,7 @@ function(toExpectedContentList FILE_NO CONTENT_VAR) unset(filtered_) foreach(part_ IN LISTS ${CONTENT_VAR}) - string(REPLACE "${TEST_MAIN_INSTALL_PREFIX_PATH}" "" part_ "${part_}") + string(REGEX REPLACE "^${TEST_MAIN_INSTALL_PREFIX_PATH}(/|$)" "" part_ "${part_}") if(part_) list(APPEND filtered_ "${prefix_}${part_}") diff --git a/Tests/RunCMake/CPack/TGZ/packaging_COMPONENT_default.cmake b/Tests/RunCMake/CPack/TGZ/packaging_COMPONENT_default.cmake new file mode 100644 index 0000000..81a5035 --- /dev/null +++ b/Tests/RunCMake/CPack/TGZ/packaging_COMPONENT_default.cmake @@ -0,0 +1 @@ +set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") diff --git a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake deleted file mode 100644 index 12970cb..0000000 --- a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/ExpectedFiles.cmake +++ /dev/null @@ -1,9 +0,0 @@ -set(EXPECTED_FILES_COUNT "1") -set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) -set(EXPECTED_FILE_1_COMPONENT "test") - -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/COMPONENTS_EMPTY_DIR/test.cmake b/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake deleted file mode 100644 index 1f35b80..0000000 --- a/Tests/RunCMake/CPack/tests/COMPONENTS_EMPTY_DIR/test.cmake +++ /dev/null @@ -1,14 +0,0 @@ -if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") - set(CPACK_DEB_COMPONENT_INSTALL "ON") - set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") -elseif(GENERATOR_TYPE STREQUAL "TGZ") - set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") -endif() - -set(CPACK_COMPONENTS_ALL test) -install(DIRECTORY DESTINATION empty - COMPONENT test) diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake index 3185e9f..0c2b37b 100644 --- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake +++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake @@ -1,16 +1,12 @@ -if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") - set(CPACK_DEB_COMPONENT_INSTALL "ON") +if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") + if(GENERATOR_TYPE STREQUAL "DEB") + set(generator_type_suffix_ "IAN") # not entirely compatible... + endif() - set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second") - set(CPACK_DEBIAN_PKG_3_FILE_NAME "pkg_3_abc.deb") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - - set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") - set(CPACK_RPM_PKG_2_PACKAGE_NAME "second") - set(CPACK_RPM_PKG_3_FILE_NAME "pkg_3_abc.rpm") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_FILE_NAME "${GENERATOR_TYPE}-DEFAULT") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_NAME "second") + string(TOLOWER "${GENERATOR_TYPE}" file_extension_) + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_3_FILE_NAME "pkg_3_abc.${file_extension_}") endif() install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake index 70b3cb3..0642d83 100644 --- a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake @@ -6,8 +6,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") string(APPEND CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id") endif() -set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CMAKE_BUILD_TYPE Debug) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" diff --git a/Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake index 1c7ff5e..7923148 100644 --- a/Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/tests/DEPENDENCIES/VerifyResult.cmake @@ -68,11 +68,11 @@ elseif(GENERATOR_TYPE STREQUAL "RPM") checkDependencies_("${FOUND_FILE_4}" "requires" "depend-default;depend-default-b") checkDependencies_("${FOUND_FILE_5}" "requires" "depend-default;depend-default-b") - checkDependencies_("${FOUND_FILE_1}" "conflicts" "conflict-application;conflict-application-b") - checkDependencies_("${FOUND_FILE_2}" "conflicts" "conflict-application;conflict-application-b") - checkDependencies_("${FOUND_FILE_3}" "conflicts" "conflict-headers") - checkDependencies_("${FOUND_FILE_4}" "conflicts" "conflict-default;conflict-default-b") - checkDependencies_("${FOUND_FILE_5}" "conflicts" "conflict-default;conflict-default-b") + checkDependencies_("${FOUND_FILE_1}" "conflicts" "conflicts-application;conflicts-application-b") + checkDependencies_("${FOUND_FILE_2}" "conflicts" "conflicts-application;conflicts-application-b") + checkDependencies_("${FOUND_FILE_3}" "conflicts" "conflicts-headers") + checkDependencies_("${FOUND_FILE_4}" "conflicts" "conflicts-default;conflicts-default-b") + checkDependencies_("${FOUND_FILE_5}" "conflicts" "conflicts-default;conflicts-default-b") checkDependencies_("${FOUND_FILE_1}" "provides" "provided-default;provided-default-b") checkDependencies_("${FOUND_FILE_2}" "provides" "provided-default;provided-default-b") diff --git a/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake b/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake index cabbba8..fbd786e 100644 --- a/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake +++ b/Tests/RunCMake/CPack/tests/DEPENDENCIES/test.cmake @@ -1,50 +1,43 @@ -if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") - set(CPACK_DEB_COMPONENT_INSTALL "ON") - #intentionaly commented out to test old file naming - #set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - - # false by default - set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS FALSE) - # FIXME can not be tested as libraries first have to be part of a package in order - # to determine their dependencies and we can not be certain if there will be any - set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_SHLIBDEPS TRUE) - - foreach(dependency_type_ DEPENDS CONFLICTS PREDEPENDS ENHANCES BREAKS REPLACES RECOMMENDS SUGGESTS) - string(TOLOWER "${dependency_type_}" lower_dependency_type_) - - set(CPACK_DEBIAN_PACKAGE_${dependency_type_} "${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b") - set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b") - set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b") - set(CPACK_DEBIAN_HEADERS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-headers") - endforeach() - - set(CPACK_DEBIAN_PACKAGE_PROVIDES "provided-default, provided-default-b") - set(CPACK_DEBIAN_LIBS_PACKAGE_PROVIDES "provided-lib") - set(CPACK_DEBIAN_LIBS_AUTO_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - - # FIXME auto autoprov is not tested at the moment as Ubuntu 15.04 rpmbuild - # does not use them correctly: https://bugs.launchpad.net/rpm/+bug/1475755 - set(CPACK_RPM_PACKAGE_AUTOREQ "no") - set(CPACK_RPM_PACKAGE_AUTOPROV "no") - set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_AUTOREQPROV "yes") - set(CPACK_RPM_LIBS_AUTO_PACKAGE_AUTOREQPROV "yes") - - set(CPACK_RPM_PACKAGE_REQUIRES "depend-default, depend-default-b") - set(CPACK_RPM_APPLICATIONS_PACKAGE_REQUIRES "depend-application, depend-application-b") - set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_REQUIRES "depend-application, depend-application-b") - set(CPACK_RPM_HEADERS_PACKAGE_REQUIRES "depend-headers") - - set(CPACK_RPM_PACKAGE_CONFLICTS "conflict-default, conflict-default-b") - set(CPACK_RPM_APPLICATIONS_PACKAGE_CONFLICTS "conflict-application, conflict-application-b") - set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_CONFLICTS "conflict-application, conflict-application-b") - set(CPACK_RPM_HEADERS_PACKAGE_CONFLICTS "conflict-headers") - - set(CPACK_RPM_PACKAGE_PROVIDES "provided-default, provided-default-b") - set(CPACK_RPM_LIBS_PACKAGE_PROVIDES "provided-lib") - set(CPACK_RPM_LIBS_AUTO_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b") +if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") + if(GENERATOR_TYPE STREQUAL "DEB") + # false by default + set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS FALSE) + # FIXME can not be tested as libraries first have to be part of a package in order + # to determine their dependencies and we can not be certain if there will be any + set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_SHLIBDEPS TRUE) + + foreach(dependency_type_ DEPENDS PREDEPENDS ENHANCES BREAKS REPLACES RECOMMENDS SUGGESTS) + string(TOLOWER "${dependency_type_}" lower_dependency_type_) + + set(CPACK_DEBIAN_PACKAGE_${dependency_type_} "${lower_dependency_type_}-default, ${lower_dependency_type_}-default-b") + set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b") + set(CPACK_DEBIAN_APPLICATIONS_AUTO_PACKAGE_${dependency_type_} "${lower_dependency_type_}-application, ${lower_dependency_type_}-application-b") + set(CPACK_DEBIAN_HEADERS_PACKAGE_${dependency_type_} "${lower_dependency_type_}-headers") + endforeach() + + set(generator_type_suffix_ "IAN") # not entirely compatible... + else() # RPM + # FIXME auto autoprov is not tested at the moment as Ubuntu 15.04 rpmbuild + # does not use them correctly: https://bugs.launchpad.net/rpm/+bug/1475755 + set(CPACK_RPM_PACKAGE_AUTOREQ "no") + set(CPACK_RPM_PACKAGE_AUTOPROV "no") + set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_AUTOREQPROV "yes") + set(CPACK_RPM_LIBS_AUTO_PACKAGE_AUTOREQPROV "yes") + + set(CPACK_RPM_PACKAGE_REQUIRES "depend-default, depend-default-b") + set(CPACK_RPM_APPLICATIONS_PACKAGE_REQUIRES "depend-application, depend-application-b") + set(CPACK_RPM_APPLICATIONS_AUTO_PACKAGE_REQUIRES "depend-application, depend-application-b") + set(CPACK_RPM_HEADERS_PACKAGE_REQUIRES "depend-headers") + endif() + + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PACKAGE_CONFLICTS "conflicts-default, conflicts-default-b") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_APPLICATIONS_PACKAGE_CONFLICTS "conflicts-application, conflicts-application-b") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_APPLICATIONS_AUTO_PACKAGE_CONFLICTS "conflicts-application, conflicts-application-b") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_HEADERS_PACKAGE_CONFLICTS "conflicts-headers") + + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PACKAGE_PROVIDES "provided-default, provided-default-b") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_LIBS_PACKAGE_PROVIDES "provided-lib") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_LIBS_AUTO_PACKAGE_PROVIDES "provided-lib_auto, provided-lib_auto-b") endif() set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) diff --git a/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake index 858a496..650687c 100644 --- a/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/EMPTY_DIR/ExpectedFiles.cmake @@ -1,3 +1,7 @@ set(EXPECTED_FILES_COUNT "1") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/empty") + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(EXPECTED_FILE_1_COMPONENT "test") +endif() diff --git a/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake b/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake index 049c4a4..cd2c9fd 100644 --- a/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake +++ b/Tests/RunCMake/CPack/tests/EMPTY_DIR/test.cmake @@ -1,7 +1,3 @@ -if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") -endif() - if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") if(GENERATOR_TYPE STREQUAL "DEB") set(generator_type_suffix_ "IAN") # not entirely compatible... @@ -12,3 +8,7 @@ endif() install(DIRECTORY DESTINATION empty COMPONENT test) + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(CPACK_COMPONENTS_ALL test) +endif() diff --git a/Tests/RunCMake/CPack/tests/EXTRA/test.cmake b/Tests/RunCMake/CPack/tests/EXTRA/test.cmake index 754561d..efa6dac 100644 --- a/Tests/RunCMake/CPack/tests/EXTRA/test.cmake +++ b/Tests/RunCMake/CPack/tests/EXTRA/test.cmake @@ -32,7 +32,4 @@ endforeach() set(CPACK_DEBIAN_BAR_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/bar/preinst;${CMAKE_CURRENT_BINARY_DIR}/bar/prerm") -set(CPACK_PACKAGE_CONTACT "someone") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - -set(CPACK_DEB_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/test.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/test.cmake index fa0bc35..90351ba 100644 --- a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/test.cmake +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/test.cmake @@ -1,5 +1,3 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/test.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/test.cmake index 2fc9e23..15c496b 100644 --- a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/test.cmake +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/test.cmake @@ -1,5 +1,3 @@ -set(CPACK_PACKAGE_CONTACT "someone") -set(CPACK_DEB_COMPONENT_INSTALL "ON") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake index e16f8e1..fb1b8de 100644 --- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake @@ -1,6 +1,4 @@ if(GENERATOR_TYPE STREQUAL "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh") set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE diff --git a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake index f6656c6..f235d47 100644 --- a/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake +++ b/Tests/RunCMake/CPack/tests/LONG_FILENAMES/test.cmake @@ -1,5 +1,4 @@ if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar") endif() diff --git a/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake index f2c4451..791c586 100644 --- a/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake +++ b/Tests/RunCMake/CPack/tests/MAIN_COMPONENT/test.cmake @@ -1,5 +1,3 @@ -set(CPACK_RPM_COMPONENT_INSTALL "ON") - install(FILES CMakeLists.txt DESTINATION foo COMPONENT applications) install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers) install(FILES CMakeLists.txt DESTINATION bas COMPONENT libs) diff --git a/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake b/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake index 4441c8e..83ed0f2 100644 --- a/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake +++ b/Tests/RunCMake/CPack/tests/MINIMAL/test.cmake @@ -1,5 +1 @@ -if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") -endif() - install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) diff --git a/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake b/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake index 31e729b..4698fb3 100644 --- a/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake +++ b/Tests/RunCMake/CPack/tests/PARTIALLY_RELOCATABLE_WARNING/test.cmake @@ -2,5 +2,3 @@ install(FILES CMakeLists.txt DESTINATION /not_relocatable COMPONENT static) set(CPACK_PACKAGE_RELOCATABLE TRUE) set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") - -set(CPACK_RPM_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake index 3fca2e2..8719c0b 100644 --- a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake +++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake @@ -1,18 +1,16 @@ -if(GENERATOR_TYPE STREQUAL "DEB") - set(CPACK_PACKAGE_CONTACT "someone") - set(CPACK_DEB_COMPONENT_INSTALL "ON") - set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") +if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM") + if(GENERATOR_TYPE STREQUAL "DEB") + set(generator_type_suffix_ "IAN") # not entirely compatible... + set(group_ "SECTION") + else() + set(group_ "GROUP") + endif() - set(CPACK_DEBIAN_PACKAGE_SECTION "default") - set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second") - set(CPACK_DEBIAN_PKG_2_PACKAGE_SECTION "second_group") -elseif(GENERATOR_TYPE STREQUAL "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_FILE_NAME "${GENERATOR_TYPE}-DEFAULT") - set(CPACK_RPM_PACKAGE_GROUP "default") - set(CPACK_RPM_PKG_2_PACKAGE_NAME "second") - set(CPACK_RPM_PKG_2_PACKAGE_GROUP "second_group") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PACKAGE_${group_} "default") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_NAME "second") + set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_${group_} "second_group") endif() install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) -- cgit v0.12 From 48456535f3c59e19572857d7071d9551783e06d6 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 27 Nov 2016 17:29:01 +0100 Subject: Tests: source CPack tests don't require build stage --- Tests/RunCMake/CPack/CPackTestHelpers.cmake | 4 ++-- Tests/RunCMake/CPack/RunCMakeTest.cmake | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake index 7e21d22..89da610 100644 --- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake +++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake @@ -100,6 +100,6 @@ function(run_cpack_test_subtests TEST_NAME SUBTEST_SUFFIXES types build PACKAGIN endforeach() endfunction() -function(run_cpack_source_test TEST_NAME types build) - run_cpack_test_common_("${TEST_NAME}" "${types}" "${build}" "" true "") +function(run_cpack_source_test TEST_NAME types) + run_cpack_test_common_("${TEST_NAME}" "${types}" false "" true "") endfunction() diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index fa966c6..092fb47 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -20,5 +20,5 @@ run_cpack_test_subtests(PACKAGE_CHECKSUM "invalid;MD5;SHA1;SHA224;SHA256;SHA384; run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM" false "COMPONENT") run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false "COMPONENT") run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component;one_component;one_component_main;no_debuginfo;one_component_no_debuginfo;no_components;valid" "RPM" true "CUSTOM") -run_cpack_source_test(SOURCE_PACKAGE "RPM" true) +run_cpack_source_test(SOURCE_PACKAGE "RPM") run_cpack_test(SUGGESTS "RPM" false "MONOLITHIC") -- cgit v0.12 From a8a47098082a57a5b22cac546f030b551e1b9c32 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 27 Nov 2016 20:35:13 +0100 Subject: Tests: CPack/DEB test change prerequirements check Prerequirements should be searched for in generator prerequirements function and only checked for presence in configure file in per test prerequirements function. --- Tests/RunCMake/CPack/DEB/Helpers.cmake | 2 -- Tests/RunCMake/CPack/DEB/Prerequirements.cmake | 7 +++++++ .../RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake | 4 ++-- .../CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake index 349b987..ad1b47b 100644 --- a/Tests/RunCMake/CPack/DEB/Helpers.cmake +++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake @@ -84,8 +84,6 @@ function(getMissingShlibsErrorExtra FILE RESULT_VAR) string(APPEND error_extra "; errors \"${deb_install_files_errors}\"") endif() - find_program(READELF_EXECUTABLE NAMES readelf) - if(READELF_EXECUTABLE) string(APPEND error_extra "; readelf \"\n") diff --git a/Tests/RunCMake/CPack/DEB/Prerequirements.cmake b/Tests/RunCMake/CPack/DEB/Prerequirements.cmake index cb9a277..60d02e7 100644 --- a/Tests/RunCMake/CPack/DEB/Prerequirements.cmake +++ b/Tests/RunCMake/CPack/DEB/Prerequirements.cmake @@ -12,4 +12,11 @@ function(get_test_prerequirements found_var config_file) file(APPEND "${config_file}" "\nset(FAKEROOT_EXECUTABLE \"${FAKEROOT_EXECUTABLE}\")") endif() + + # optional tool for some tests + find_program(READELF_EXECUTABLE NAMES readelf) + if(READELF_EXECUTABLE) + file(APPEND "${config_file}" + "\nset(READELF_EXECUTABLE \"${READELF_EXECUTABLE}\")") + endif() endfunction() diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake index b98065a..be44b2e 100644 --- a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake @@ -1,5 +1,5 @@ -function(get_test_prerequirements found_var) - find_program(READELF_EXECUTABLE NAMES readelf) +function(get_test_prerequirements found_var config_file) + include(${config_file}) if(READELF_EXECUTABLE) set(${found_var} true PARENT_SCOPE) diff --git a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake index b98065a..be44b2e 100644 --- a/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake +++ b/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake @@ -1,5 +1,5 @@ -function(get_test_prerequirements found_var) - find_program(READELF_EXECUTABLE NAMES readelf) +function(get_test_prerequirements found_var config_file) + include(${config_file}) if(READELF_EXECUTABLE) set(${found_var} true PARENT_SCOPE) -- cgit v0.12 From 50c3ebb90309d3165b30c243b4047a71eba34f73 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 27 Nov 2016 23:11:37 +0100 Subject: Tests: CPack test documentation facelift --- Tests/RunCMake/CPack/README.txt | 168 ++++++++++++++++++++++++++++++++-------- 1 file changed, 136 insertions(+), 32 deletions(-) diff --git a/Tests/RunCMake/CPack/README.txt b/Tests/RunCMake/CPack/README.txt index 5c86880..f51d254 100644 --- a/Tests/RunCMake/CPack/README.txt +++ b/Tests/RunCMake/CPack/README.txt @@ -1,41 +1,75 @@ RunCMake.CPack is a test module that is intended for testing of package generators that can be validated from command line. -TODO: all tests should cover all packaging types (single package, grouped and - component packaging) - ------------- Adding a test ------------- -CPack test root directory: 'Tests/RunCMake/CPack'. +CPack test root directory: 'Tests/RunCMake/CPack/tests'. All phases are executed separately for each generator that is bound to a test. Tests for each generator are subtests of test 'RunCMake.CPack_'. Each test must also be added to 'RunCMakeTest.cmake' script located in CPack test root directory. + Line that adds a test is: -run_cpack_test( "") +run_cpack_test( "" + "") + + may be one generator e.g. "RPM" or multiple e.g. "RPM;DEB" +and will be run for all listed generators. In test and verification scripts +current generator can be accessed through GENERATOR_TYPE variable. + + is a boolean variable that enables or disables compile stage - +most tests don't require compilation as a non binary file can be used for +package content but sometimes an executable or a library has to be created +before the packaging stage. - may be one generator e.g. "RPM" or multiple e.g. "RPM;DEB" and -will be run for all listed generators. + can be a list of one or more packaging types: MONOLITHIC, +COMPONENT or GROUP - each type sets per generator default variables which can +be overwritten in the test if needed +(see /packaging__default.cmake for the variables +that are set by default for each packaging type). +Alternatively CUSTOM value can be set which means that default values will not +be set and that values will be set manually in the test itself. + +Alternatively a test with subtests can be added: +run_cpack_test_subtests( "" "" + "") + + is the only new parameter and it is a list of names that will +be used for subtests. In test and verification scripts subtest name can be +accessed through RunCMake_SUBTEST_SUFFIX variable. + +Also source package tests can be added: +run_cpack_source_test( "" true) Test consists of - test prerequirements phase (optional) - CMake execution phase +- build phase (optional and not available for source package tests) - CPack execution phase - verification of generated files +The phases are executed once per specified generator, packaging type and subtest +combinatiion. + test prerequirements phase (optional): -------------------------------------- In some cases individual tests for certain generator need additional prerequirements met. -In such cases '/-Prerequirements.cmake' file -containing 'function(get_test_prerequirements found_var)' should be created. -Function should return true if all prerequirements are met. +In such cases '/-Prerequirements.cmake' file +containing 'function(get_test_prerequirements found_var config_file)' should be +created. Function should return true in found_var if all prerequirements are +met. config_file variable contains the location of config file generated by the +generator so that this function can check if prerequired variable is set in the +file. +NOTE: All required programs should be searched for in generator prerequirements +function and only checked for the variable in configure file in per test +function. If prerequirements are not met test will be skipped outputting ' - SKIPPED' string. Note that this doesn't fail the entire test @@ -48,15 +82,21 @@ TODO: skipped tests should provide expected error string so test should fail CMake execution phase: ---------------------- -To add a new CPack test we first create a .cmake script that contains -CMake commands that should be used as a preparation script for generation of -different types of packages. This script is placed into CPack test root -directory even if it will be used for only one of the generators. +To add a new CPack test we first create a '/test.cmake' script that +contains CMake commands that should be used as a preparation script for +generation of different types of packages. This script is placed into CPack +test root directory. If test will be used for multiple generators but some of them require some -generator specific commands then those commands should be added to a separate -file that should be located in '/-specifics.cmake' -in CPack test root directory. +generator specific commands then those commands should be added to 'test.cmake' +script wrapped with 'if(GENERATOR_TYPE STREQUAL )'. + +build phase (optional and not available for source package tests) +----------------------------------------------------------------- + +This phase only runs make command. + +NOTE: By default all tests have CMAKE_BUILD_TYPE variable set to Debug. CPack execution phase: ---------------------- @@ -64,6 +104,8 @@ CPack execution phase: Only executes CPack for content that was generated during CMake execution phase. +NOTE: By default CPACK_PACKAGE_NAME variable is set to lower case test name. + Verification of generated files: -------------------------------- @@ -76,24 +118,49 @@ contain expected files. Mandatory verification phase also checks that no other unexpected package files were generated (this is executed even if EXPECTED_FILES_COUNT contains 0 in order to verify that no files were generated). -CMake script '/-ExpectedFiles.cmake' is required by +CMake script '/ExpectedFiles.cmake' is required by this step and must contain - EXPECTED_FILES_COUNT variable that contains the number of expected files that will be generated (0 or more) + - EXPECTED_FILE_ that contains globing expression that uniquely defines expected file name (will be used to find expected file) - and should be present once for each expected file + and should be present once for each expected file. + NOTE: This variable should be used only as last resort as it sets generator + specific globbing expression. Each generator can recreate file name from + parts that are already populated by default but can always be + overwritten if needed: + - EXPECTED_FILE__NAME is the name component of + the file (by default it is set to package name that is same as test name + in lowercase) + - EXPECTED_FILE__VERSION is the version of the + package (by default it is set to '0.1.1') + - EXPECTED_FILE__REVISION is the revision of the + package (by default it is set to '1') + - EXPECTED_FILE_CONTENT_ that contains regular expression of files that should be present in generated file and should be present once for each expected file + NOTE: This variable should be used only as last resort as it sets generator + specific regular expression. + EXPECTED_FILE_CONTENT__LIST should be + prefered as it requires a list of expected files and directories that + is later changed automatically depending on the generator so expected + package content can be written only once per test for all generators. Optional verification phase is generator specific and is optionaly executed. -This phase is executed if '/-VerifyResult.cmake' -script exists. -In case that the script doesn't exist VerifyResult.cmake script automatically -prints out standard output and standard error from CPack execution phase that -is compared with '/-stdout.txt' regular expression -and '/-stderr.txt' regular expresson respectively. +This phase is executed if '/VerifyResult.cmake' script exists. + +VerifyResult.cmake script also automatically prints out standard output and +standard error from CPack execution phase that is compared with +'/-stdout.txt' regular expression and +and '/-stderr.txt' regular expresson respectively. +NOTE: For subtests generator name can also be suffixed with subtest name and in + such case subtest file is preferred. + File name format: '--std.txt' where + can either be 'out' or 'err'. +NOTE: If none of the comparison files are present then the default generator + file is used if present. ---------------------- Adding a new generator @@ -101,13 +168,44 @@ Adding a new generator To add a new generator we must - add new generator directory (e.g. RPM for RPM generator) to CPack test root - directory that contains 'Helpers.cmake' script. In this script a function - named 'getPackageContent' must exist. This function should list files that - are contained in a package. Function should accept two parameters - + FILE variable that will contain path to file for which the content should be - listed - + RESULT_VAR that will tell the function which variable in parent scope should - contain the result (list of files inside package file) + directory that contains 'Helpers.cmake' script. + - In this script some functions must exist: + - getPackageContent: This function should list files that are contained in + a package. + Function parameters: + + FILE variable that will contain path to file for which the content + should be listed + + RESULT_VAR that will tell the function which variable in parent scope + should contain the result (list of files inside package file) + - getPackageNameGlobexpr: This function should generate package name + globbing expression. + Function parameters: + + NAME that will contain the expected package name + + COMPONENT that will contain the expected package component + + VERSION that will contain the expected package version + + REVISION that will contain the expected package revision number + + FILE_NO that will contain the file number for which the globbing + expression is generated + + RESULT_VAR that will tell the function which variable in parent scope + should contain the result (file name globbing expression) + - getPackageContentList: This function should return a list of files and + directories that are in the provided package. + Function parameters: + + FILE that will contain the package file for which the package content + should be returned. + + RESULT_VAR that will tell the function which variable in parent scope + should contain the result (list of pacakge content) + - toExpectedContentList: This function should convert an expected package + content list into one that is expected for the + generator (e.g. rpm packages have install/relocate + path prefixes which aren't part of the package so + those paths have to be removed from the expected + content list). + Function parameters: + + FILE_NO that will contain the file number for which the conversion + should be performed + + CONTENT_VAR that will contain the input list and is also the variable + in parent scope which should contain the result (converted content list) - add 'Prerequirements.cmake' script to generator directory. In this script a function named 'get_test_prerequirements' must exist. This function should set a variable in parent scope (name of the variable is the first parameter) @@ -119,3 +217,9 @@ To add a new generator we must - add tests the same way as described above - add generator to 'add_RunCMake_test_group' function call that is located in RunCMake CMakeLists.txt file +- if needed add 'packaging__default.cmake' scripts that define + default variables that will be set for each packaging type (MONOLITHIC, + COMPONENT and GROUP) +- if needed add 'default_expected_std.txt' files where is either + 'out' or 'err' which will contain default expected output of package + generation regular expression. -- cgit v0.12