summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2016-05-15 01:01:34 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2016-05-15 01:01:34 (GMT)
commit44ee2d717a0f0552d4d1d5978c473d60625a0b3c (patch)
tree058d32470b4afd1e3b37c411db51fd90347c6c50 /Tests
parentb952336902e9206ba51e1d77b8e489bdd759f73f (diff)
downloadCMake-44ee2d717a0f0552d4d1d5978c473d60625a0b3c.zip
CMake-44ee2d717a0f0552d4d1d5978c473d60625a0b3c.tar.gz
CMake-44ee2d717a0f0552d4d1d5978c473d60625a0b3c.tar.bz2
CPack/RPM different package names
Packagers may now set their own rpm package file names or request that rpmbuild tool chooses one for them. It also supports handing of situations where one spec file may produce multiple rpm packages.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake2
-rw-r--r--Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-ExpectedFiles.cmake9
-rw-r--r--Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt3
-rw-r--r--Tests/RunCMake/CPack/RPM_CUSTOM_NAMES.cmake11
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake1
5 files changed, 25 insertions, 1 deletions
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index e956f17..cd5e17e 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -118,7 +118,7 @@ if(expected_file_mask)
message(STATUS "expected_file_mask='${expected_file_mask}'")
if(NOT expected_file)
- message(FATAL_ERROR "error: expected_file=${expected_file} does not exist: CPackComponentsForAll test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error}")
+ message(FATAL_ERROR "error: expected_file does not exist: CPackComponentsForAll test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error}")
endif()
list(LENGTH expected_file actual_count)
diff --git a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-ExpectedFiles.cmake
new file mode 100644
index 0000000..780e57e
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-ExpectedFiles.cmake
@@ -0,0 +1,9 @@
+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/RPM_CUSTOM_NAMES-stderr.txt b/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt
new file mode 100644
index 0000000..d3ba7b0
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt
@@ -0,0 +1,3 @@
+^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/RPM_CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_1.spec
+CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/RPM_CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/second.spec
+CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/RPM_CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_3.spec$
diff --git a/Tests/RunCMake/CPack/RPM_CUSTOM_NAMES.cmake b/Tests/RunCMake/CPack/RPM_CUSTOM_NAMES.cmake
new file mode 100644
index 0000000..ba53a87
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM_CUSTOM_NAMES.cmake
@@ -0,0 +1,11 @@
+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")
+
+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/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index ee4112d..d34e751 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -10,5 +10,6 @@ run_cpack_test(DEB_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(RPM_CUSTOM_NAMES "RPM" true)
run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false)
run_cpack_test(INSTALL_SCRIPTS "RPM" false)