diff options
author | Brad King <brad.king@kitware.com> | 2020-07-02 14:03:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-07-02 20:39:57 (GMT) |
commit | 925c026c31551bee2c28069d85eed4fb22e79b3f (patch) | |
tree | 00521fba865cace6de5b894d2167ef87a81cc09f /Tests/CPackComponentsForAll | |
parent | 29d2d4805fbad653761ee92bbd0850e1c20de37b (diff) | |
download | CMake-925c026c31551bee2c28069d85eed4fb22e79b3f.zip CMake-925c026c31551bee2c28069d85eed4fb22e79b3f.tar.gz CMake-925c026c31551bee2c28069d85eed4fb22e79b3f.tar.bz2 |
Tests: Verify SLA in CPackComponentsForAll-DragNDrop-* DMG files
Issue: #20889
Diffstat (limited to 'Tests/CPackComponentsForAll')
-rw-r--r-- | Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index 253d128..7ab8820 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -88,12 +88,14 @@ if(CPackGen MATCHES "DragNDrop") set(expected_file_mask "${CPackComponentsForAll_BINARY_DIR}/MyLib-*.dmg") if(${CPackComponentWay} STREQUAL "default") set(expected_count 1) + set(expect_dmg_sla 1) elseif(${CPackComponentWay} STREQUAL "OnePackPerGroup") set(expected_count 3) elseif(${CPackComponentWay} STREQUAL "IgnoreGroup") set(expected_count 4) elseif(${CPackComponentWay} STREQUAL "AllInOne") set(expected_count 1) + set(expect_dmg_sla 1) endif() endif() @@ -138,6 +140,20 @@ if(expected_file_mask) if(NOT actual_count EQUAL expected_count) message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})") endif() + + if(expect_dmg_sla) + execute_process(COMMAND hdiutil udifderez -xml "${expected_file}" OUTPUT_VARIABLE out ERROR_VARIABLE err RESULT_VARIABLE res) + if(NOT res EQUAL 0) + string(REPLACE "\n" "\n " err " ${err}") + message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${expected_file}\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 ${expected_file}\ndid not show '${key}' key:\n${out}") + endif() + endforeach() + endif() endif() # Validate content |