From 9b4154ace94c210cd93320638db883e32a4a6df8 Mon Sep 17 00:00:00 2001 From: Roland Schulz Date: Mon, 4 Aug 2014 22:05:04 -0400 Subject: [PATCH] Check MD5sum for regressiontest Because we decided it is important for FFTW we should do it for the tests too. Is only done for non -dev versions. Change-Id: Id7d1ee027bd302ad7cb10f46d93b0f435872c67e --- CMakeLists.txt | 3 +++ tests/CMakeLists.txt | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98d0ab7bd8..2abc0d729a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,9 @@ set(PROJECT_VERSION "5.0.1-dev") # number of the regressiontest tarball against which the code tarball # can be tested. This will be the version of the last patch release. set(REGRESSIONTEST_VERSION "5.0.1-dev") +# The MD5 checksum of the regressiontest tarball. Only used if "-dev" +# is not present in the PROJECT_VERSION +set(REGRESSIONTEST_MD5SUM "a07524afebca5013540d4f2f72df2dce") # If this is not a released tarball, "-dev" will be present in # PROJECT_VERSION, and REGRESSIONTEST_BRANCH specifies the name of the # gerrit.gromacs.org branch whose HEAD can test this code, *if* this diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 589ccc9974..fb611ffd20 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -60,6 +60,12 @@ status_code: ${status_code} status_string: ${status_string} log: ${log}") endif() + if(NOT "${PROJECT_VERSION}" MATCHES "-dev") + file(MD5 ${REGRESSIONTEST_FILE} COMPUTED_MD5SUM) + if(NOT ${REGRESSIONTEST_MD5SUM} STREQUAL ${COMPUTED_MD5SUM}) + message(FATAL_ERROR "Download of regressiontests failed. Expected MD5 of ${REGRESSIONTEST_MD5SUM} but download has ${COMPUTED_MD5SUM}") + endif() + endif() file(REMOVE_RECURSE "${REGRESSIONTEST_PATH}") #delete potential prior folder execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${REGRESSIONTEST_FILE}" -- 2.22.0