diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2016-11-27 14:30:46 (GMT) |
---|---|---|
committer | Domen Vrankar <domen.vrankar@gmail.com> | 2016-11-27 22:20:35 (GMT) |
commit | b687d2ba093b1b79e9faf09e45d11567b0ec9ac1 (patch) | |
tree | e71ea1d488d0e1130fa2f211bdabff0a322fc86b /Tests/RunCMake/CPack/VerifyResult.cmake | |
parent | ed8858edb7c5100e1928c5a94f85485f0e322aa7 (diff) | |
download | CMake-b687d2ba093b1b79e9faf09e45d11567b0ec9ac1.zip CMake-b687d2ba093b1b79e9faf09e45d11567b0ec9ac1.tar.gz CMake-b687d2ba093b1b79e9faf09e45d11567b0ec9ac1.tar.bz2 |
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.
Diffstat (limited to 'Tests/RunCMake/CPack/VerifyResult.cmake')
-rw-r--r-- | Tests/RunCMake/CPack/VerifyResult.cmake | 22 |
1 files changed, 19 insertions, 3 deletions
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}") |