From: Mark Abraham Date: Fri, 11 Apr 2014 12:11:00 +0000 (+0200) Subject: Fix and simplify version matching for running tests X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=0e06005af8eb09ca1e9b235bb1e02bb02f62418e;p=alexxy%2Fgromacs.git Fix and simplify version matching for running tests The version strings that might need bumping for releases and branch forks are now all maintained in one place, and are always defined. Correct behaviour follows from whether the "-dev" tag is present in PROJECT_VERSION. When this patch is merged with master branch, preserve the bump to PROJECT_VERSION that is already in master branch, and change release-5-0 to master branch for REGRESSIONTEST_BRANCH. Change-Id: I4a5579f00e487273f8e08bad5613ecceac7bf682 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a730a9e35..03f24b6f0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,12 +52,20 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) # machine with no git. # # NOTE: when releasing the "-dev" suffix needs to be stripped off! +# REGRESSIONTEST_VERSION and REGRESSIONTEST_BRANCH should always be +# defined. set(PROJECT_VERSION "5.0-rc1-dev") -# The version number of the regressiontest tarball against which this -# git branch can be tested. Normally, this will be the version of the -# last patch release. Comment the next line out for branches leading -# to a major/minor release. +# If this is a released tarball, "-dev" will not be present in +# PROJECT_VERSION, and REGRESSIONTEST_VERSION specifies the version +# 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-rc1") +# 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 +# code contains all recent fixes from the corresponding code branch. +set(REGRESSIONTEST_BRANCH "refs/heads/release-5-0") + set(CUSTOM_VERSION_STRING "" CACHE STRING "Custom version string (if empty, use hard-coded default)") mark_as_advanced(CUSTOM_VERSION_STRING) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f7bb023229..589ccc9974 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,17 +39,10 @@ option(REGRESSIONTEST_DOWNLOAD if(REGRESSIONTEST_DOWNLOAD) if("${PROJECT_VERSION}" MATCHES "-dev") - if("${PROJECT_VERSION}" MATCHES "^5[.]") - set(REGRESSIONTEST_URL http://gerrit.gromacs.org/snapshot/refs/heads/master) - else() - set(REGRESSIONTEST_URL http://gerrit.gromacs.org/snapshot/refs/heads/release-4-6) - endif() + set(REGRESSIONTEST_URL http://gerrit.gromacs.org/snapshot/${REGRESSIONTEST_BRANCH}) set(REGRESSIONTEST_PATH "${CMAKE_CURRENT_BINARY_DIR}/regressiontests" CACHE PATH "Path to auto-downloaded regressiontests" FORCE) else() - if(NOT REGRESSIONTEST_VERSION) - message(FATAL_ERROR "The configuration files do not specify what regressiontests tarball is suitable for automated download and testing. Please obtain and use a suitable set of tests yourself.") - endif() set(REGRESSIONTEST_URL http://gerrit.gromacs.org/download/regressiontests-${REGRESSIONTEST_VERSION}.tar.gz) set(REGRESSIONTEST_PATH "${CMAKE_CURRENT_BINARY_DIR}/regressiontests-${REGRESSIONTEST_VERSION}"