diff options
5 files changed, 31 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index eb9ff03..d318ce6 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -21,6 +21,7 @@ if(NOT "${DEBUGEDIT}" STREQUAL "DEBUGEDIT-NOTFOUND") endif() run_cpack_test(DIST "RPM.DIST" false "MONOLITHIC") run_cpack_test(DMG_SLA "DragNDrop" false "MONOLITHIC") +run_cpack_test(DMG_SLA_FILE "DragNDrop" false "MONOLITHIC") run_cpack_test(EMPTY_DIR "RPM.EMPTY_DIR;DEB.EMPTY_DIR;TGZ" true "MONOLITHIC;COMPONENT") run_cpack_test(VERSION "RPM.VERSION;DEB.VERSION" false "MONOLITHIC;COMPONENT") run_cpack_test(EXTRA "DEB.EXTRA" false "COMPONENT") diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA_FILE/Example.txt b/Tests/RunCMake/CPack/tests/DMG_SLA_FILE/Example.txt new file mode 100644 index 0000000..94b19c3 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DMG_SLA_FILE/Example.txt @@ -0,0 +1,4 @@ +Example License File +-------------------- + +This is an example license file for a DMG. diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA_FILE/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DMG_SLA_FILE/ExpectedFiles.cmake new file mode 100644 index 0000000..d1a3a5f --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DMG_SLA_FILE/ExpectedFiles.cmake @@ -0,0 +1,2 @@ +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA_FILE/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DMG_SLA_FILE/VerifyResult.cmake new file mode 100644 index 0000000..55fb3fb --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DMG_SLA_FILE/VerifyResult.cmake @@ -0,0 +1,22 @@ +set(dmg "${bin_dir}/${FOUND_FILE_1}") +execute_process(COMMAND hdiutil udifderez -xml "${dmg}" OUTPUT_VARIABLE out ERROR_VARIABLE err RESULT_VARIABLE res) +if(NOT res EQUAL 0) + string(REPLACE "\n" "\n " err " ${err}") + message(FATAL_ERROR "Running 'hdiutil udifderez -xml' on\n ${dmg}\nfailed with:\n${err}") +endif() +foreach(key "LPic" "STR#" "TEXT") + if(NOT out MATCHES "<key>${key}</key>") + string(REPLACE "\n" "\n " out " ${out}") + message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${dmg}\ndid not show '${key}' key:\n${out}") + endif() +endforeach() +foreach(line + # TEXT first and last base64 lines + "\tRXhhbXBsZSBMaWNlbnNlIEZpbGUNLS0tLS0tLS0tLS0tLS0tLS0t\n" + "\tYSBETUcuDQ0=\n" + ) + if(NOT out MATCHES "${line}") + string(REPLACE "\n" "\n " out " ${out}") + message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${dmg}\ndid not show '${line}':\n${out}") + endif() +endforeach() diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA_FILE/test.cmake b/Tests/RunCMake/CPack/tests/DMG_SLA_FILE/test.cmake new file mode 100644 index 0000000..eac820e --- /dev/null +++ b/Tests/RunCMake/CPack/tests/DMG_SLA_FILE/test.cmake @@ -0,0 +1,2 @@ +install(FILES CMakeLists.txt DESTINATION foo) +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_LIST_DIR}/Example.txt") |