Fix and simplify version matching for running tests
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 11 Apr 2014 12:11:00 +0000 (14:11 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 16 Apr 2014 05:36:40 +0000 (07:36 +0200)
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

CMakeLists.txt
tests/CMakeLists.txt

index 7a730a9e356eccdd08449d0ec9a30ab9c41f69ad..03f24b6f0ca6e056031a86d5cb99dc4e9dff8f43 100644 (file)
@@ -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)
index f7bb023229fee39d4cdf2cacb9812053a9cc74a5..589ccc9974a421f9b0e2b85784a934562c744ed6 100644 (file)
@@ -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}"