diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2015-06-05 19:03:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-06-15 19:09:07 (GMT) |
commit | e726fc025a3543c0be8a4eb217b0a80f9c16051c (patch) | |
tree | 2ed4f4114caff68ff16d06fc2e0e518ff6f5a771 /Tests/RunCMake/CPack/DEB | |
parent | 092f1539af99e031c99a74d5a0f24731f58bf10a (diff) | |
download | CMake-e726fc025a3543c0be8a4eb217b0a80f9c16051c.zip CMake-e726fc025a3543c0be8a4eb217b0a80f9c16051c.tar.gz CMake-e726fc025a3543c0be8a4eb217b0a80f9c16051c.tar.bz2 |
Tests: Add RunCMake tests for CPack{Deb,RPM}
Add script structure for easier addition of new CPack related tests.
Diffstat (limited to 'Tests/RunCMake/CPack/DEB')
-rw-r--r-- | Tests/RunCMake/CPack/DEB/Helpers.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/DEB/MINIMAL-ExpectedFiles.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/DEB/Prerequirements.cmake | 8 |
4 files changed, 24 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake new file mode 100644 index 0000000..4ed3fbd --- /dev/null +++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake @@ -0,0 +1,10 @@ +set(ALL_FILES_GLOB "*.deb") + +function(getPackageContent FILE RESULT_VAR) + execute_process(COMMAND ${DPKG_EXECUTABLE} -c ${FILE} + OUTPUT_VARIABLE package_content_ + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE) +endfunction() diff --git a/Tests/RunCMake/CPack/DEB/MINIMAL-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/MINIMAL-ExpectedFiles.cmake new file mode 100644 index 0000000..9e4aa7c --- /dev/null +++ b/Tests/RunCMake/CPack/DEB/MINIMAL-ExpectedFiles.cmake @@ -0,0 +1,5 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "minimal*.deb") +set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/foo/${whitespaces_}.*/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake b/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake new file mode 100644 index 0000000..8821ab9 --- /dev/null +++ b/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake @@ -0,0 +1 @@ +set(CPACK_PACKAGE_CONTACT "someone") diff --git a/Tests/RunCMake/CPack/DEB/Prerequirements.cmake b/Tests/RunCMake/CPack/DEB/Prerequirements.cmake new file mode 100644 index 0000000..197b99d --- /dev/null +++ b/Tests/RunCMake/CPack/DEB/Prerequirements.cmake @@ -0,0 +1,8 @@ +function(get_test_prerequirements found_var config_file) + find_program(DPKG_EXECUTABLE dpkg) + + if(DPKG_EXECUTABLE) + file(WRITE "${config_file}" "set(DPKG_EXECUTABLE \"${DPKG_EXECUTABLE}\")") + set(${found_var} true PARENT_SCOPE) + endif() +endfunction() |