summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2016-11-26 19:37:07 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2016-11-27 22:20:35 (GMT)
commit8575affa4c72e1c0d07f964d2f28eb6ddbadb291 (patch)
treec3a77601235a27d120bc983cbc56cdc493d7aa26 /Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM
parent79443e1b8b604de00d269e73a977f449bc3fcef2 (diff)
downloadCMake-8575affa4c72e1c0d07f964d2f28eb6ddbadb291.zip
CMake-8575affa4c72e1c0d07f964d2f28eb6ddbadb291.tar.gz
CMake-8575affa4c72e1c0d07f964d2f28eb6ddbadb291.tar.bz2
Tests: CPack test move and merge VerifyResult
Merge VerifyResult of different generators pertest and move the file to its test dir.
Diffstat (limited to 'Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM')
-rw-r--r--Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/VerifyResult.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/VerifyResult.cmake
new file mode 100644
index 0000000..e4f9618
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/PACKAGE_CHECKSUM/VerifyResult.cmake
@@ -0,0 +1,12 @@
+if(NOT ${RunCMake_SUBTEST_SUFFIX} MATCHES "invalid")
+ string(TOLOWER ${RunCMake_SUBTEST_SUFFIX} EXTENSION)
+ file(GLOB PACKAGE RELATIVE ${bin_dir} "*.tar.gz")
+ file(GLOB CSUMFILE RELATIVE ${bin_dir} "*.${EXTENSION}")
+ file(STRINGS ${CSUMFILE} CHSUM_VALUE)
+ file(${RunCMake_SUBTEST_SUFFIX} ${PACKAGE} expected_value )
+ set(expected_value "${expected_value} ${PACKAGE}")
+
+ if(NOT expected_value STREQUAL CHSUM_VALUE)
+ message(FATAL_ERROR "Generated checksum is not valid! Expected [${expected_value}] Got [${CHSUM_VALUE}]")
+ endif()
+endif()