From cabe00e1778eaff52d036ef51ba26e46f6ed2404 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 22:24:50 +0100 Subject: [PATCH] Changes from Martin Beaudoin: test loop --- CMakeLists.txt | 47 ++++++++++++------- .../1.6-ext/CMakeFiles/CMakeLists.txt | 47 ++++++++++++------- 2 files changed, 58 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7ea6858d..bd8595535 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,10 @@ -# /*---------------------------------------------------------------------------*\ +# /*-------------------------------------------------------------------------*\ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -# ------------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- # License # This file is part of OpenFOAM. # @@ -23,17 +23,17 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # Description -# CMakeLists.txt file for implementing a test harness for the compilation -# and test of OpenFOAM-1.5-dev using Kitware CTest./CMake/CDash +# CMakeLists.txt file for implementing a test harness for the compilation +# and test of OpenFOAM-1.5-dev using Kitware CTest./CMake/CDash # -# The results will be submitted to the CDash server identified by the file -# CTestConfig.cmake +# The results will be submitted to the CDash server identified by the file +# CTestConfig.cmake # # Author -# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved +# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved # # -# \*---------------------------------------------------------------------------*/ +# \*-------------------------------------------------------------------------*/ cmake_minimum_required (VERSION 2.8) @@ -82,14 +82,12 @@ SET( # Find out the version of the compiler being used. # Add this information to the buildname -# This is for gcc -IF(CMAKE_COMPILER_IS_GNUCC) - EXEC_PROGRAM(${CMAKE_CXX_COMPILER} - ARGS -dumpversion - OUTPUT_VARIABLE COMPILER_VERSION - ) - SET(BUILDNAME "${BUILDNAME}-gcc${COMPILER_VERSION}") -ENDIF(CMAKE_COMPILER_IS_GNUCC) +# This is for gcc or icc because they both support the -dumpversion option +EXEC_PROGRAM($ENV{WM_CC} + ARGS -dumpversion + OUTPUT_VARIABLE COMPILER_VERSION +) +SET(BUILDNAME "${BUILDNAME}-$ENV{WM_CC}${COMPILER_VERSION}") # # We will support more compilers eventually. # @@ -99,7 +97,7 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC) # DART_TESTING_TIMEOUT 14400 # CACHE STRING "Maximum time allowed (4 hours) before CTest will kill the test." #) -# Timeout for running all this: 10 minutes : 600 secondes +# Timeout for running all this: 10 minutes : 600 seconds SET( DART_TESTING_TIMEOUT 600 CACHE STRING "Maximum time allowed (10 minutes) before CTest will kill the test." @@ -119,9 +117,22 @@ set (UPDATE_TYPE git) # find_package(Git) if(GIT_FOUND) - message("Git was found: ${GIT_EXECUTABLE}") + message("Git was found: ${GIT_EXECUTABLE}") + + # Adding the name of the git branch to the build name + EXEC_PROGRAM(git + ARGS branch --no-color 2> /dev/null | grep '*'| awk '{print $2}' + OUTPUT_VARIABLE GIT_BRANCH_NAME + ) + message("Git branch: ${GIT_BRANCH_NAME}") + SET(BUILDNAME "${BUILDNAME}-git-branch:${GIT_BRANCH_NAME}") endif() +# Some last minute cleanup +# Seems like no '/' are allowed in the BUILDNAME or in the SITE name +string(REPLACE "/" "_" BUILDNAME ${BUILDNAME}) +string(REPLACE "/" "_" SITE ${SITE}) + # Build section #----------------------------------------------------------------------------- diff --git a/testHarness/OpenFOAM/1.6-ext/CMakeFiles/CMakeLists.txt b/testHarness/OpenFOAM/1.6-ext/CMakeFiles/CMakeLists.txt index f7ea6858d..bd8595535 100644 --- a/testHarness/OpenFOAM/1.6-ext/CMakeFiles/CMakeLists.txt +++ b/testHarness/OpenFOAM/1.6-ext/CMakeFiles/CMakeLists.txt @@ -1,10 +1,10 @@ -# /*---------------------------------------------------------------------------*\ +# /*-------------------------------------------------------------------------*\ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -# ------------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- # License # This file is part of OpenFOAM. # @@ -23,17 +23,17 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # Description -# CMakeLists.txt file for implementing a test harness for the compilation -# and test of OpenFOAM-1.5-dev using Kitware CTest./CMake/CDash +# CMakeLists.txt file for implementing a test harness for the compilation +# and test of OpenFOAM-1.5-dev using Kitware CTest./CMake/CDash # -# The results will be submitted to the CDash server identified by the file -# CTestConfig.cmake +# The results will be submitted to the CDash server identified by the file +# CTestConfig.cmake # # Author -# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved +# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved # # -# \*---------------------------------------------------------------------------*/ +# \*-------------------------------------------------------------------------*/ cmake_minimum_required (VERSION 2.8) @@ -82,14 +82,12 @@ SET( # Find out the version of the compiler being used. # Add this information to the buildname -# This is for gcc -IF(CMAKE_COMPILER_IS_GNUCC) - EXEC_PROGRAM(${CMAKE_CXX_COMPILER} - ARGS -dumpversion - OUTPUT_VARIABLE COMPILER_VERSION - ) - SET(BUILDNAME "${BUILDNAME}-gcc${COMPILER_VERSION}") -ENDIF(CMAKE_COMPILER_IS_GNUCC) +# This is for gcc or icc because they both support the -dumpversion option +EXEC_PROGRAM($ENV{WM_CC} + ARGS -dumpversion + OUTPUT_VARIABLE COMPILER_VERSION +) +SET(BUILDNAME "${BUILDNAME}-$ENV{WM_CC}${COMPILER_VERSION}") # # We will support more compilers eventually. # @@ -99,7 +97,7 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC) # DART_TESTING_TIMEOUT 14400 # CACHE STRING "Maximum time allowed (4 hours) before CTest will kill the test." #) -# Timeout for running all this: 10 minutes : 600 secondes +# Timeout for running all this: 10 minutes : 600 seconds SET( DART_TESTING_TIMEOUT 600 CACHE STRING "Maximum time allowed (10 minutes) before CTest will kill the test." @@ -119,9 +117,22 @@ set (UPDATE_TYPE git) # find_package(Git) if(GIT_FOUND) - message("Git was found: ${GIT_EXECUTABLE}") + message("Git was found: ${GIT_EXECUTABLE}") + + # Adding the name of the git branch to the build name + EXEC_PROGRAM(git + ARGS branch --no-color 2> /dev/null | grep '*'| awk '{print $2}' + OUTPUT_VARIABLE GIT_BRANCH_NAME + ) + message("Git branch: ${GIT_BRANCH_NAME}") + SET(BUILDNAME "${BUILDNAME}-git-branch:${GIT_BRANCH_NAME}") endif() +# Some last minute cleanup +# Seems like no '/' are allowed in the BUILDNAME or in the SITE name +string(REPLACE "/" "_" BUILDNAME ${BUILDNAME}) +string(REPLACE "/" "_" SITE ${SITE}) + # Build section #-----------------------------------------------------------------------------