Bugfix for the test harness: Martin Beaudoin

This commit is contained in:
Hrvoje Jasak 2018-05-15 10:48:37 +01:00
commit 7d9f975a8e
3 changed files with 28 additions and 22 deletions

View file

@ -1,7 +1,7 @@
# /*-------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration | Version: 4.0
# \\ / O peration | Version: 4.1
# \\ / A nd | Web: http://www.foam-extend.org
# \\/ M anipulation | For copyright notice see file Copyright
# -----------------------------------------------------------------------------
@ -23,7 +23,7 @@
#
# Description
# CMakeLists.txt file for implementing a test harness for the compilation
# and test of foam-extend-3.2 using Kitware CTest/CMake/CDash
# and test of foam-extend-4.1 using Kitware CTest/CMake/CDash
#
# The results will be submitted to the CDash server identified by the file
# CTestConfig.cmake
@ -36,7 +36,7 @@
cmake_minimum_required (VERSION 2.8)
PROJECT(foam-extend-4.0)
PROJECT(foam-extend-4.1)
#-----------------------------------------------------------------------------
# Utility functions
@ -52,13 +52,16 @@ function(GetHostName var)
execute_process(
COMMAND hostname
OUTPUT_VARIABLE thisHostname
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else()
execute_process(
COMMAND hostname -f
OUTPUT_VARIABLE thisHostname
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
set(${var} ${thisHostname} PARENT_SCOPE)
endfunction()

View file

@ -1,7 +1,7 @@
# /*-------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration | Version: 4.0
# \\ / O peration | Version: 4.1
# \\ / A nd | Web: http://www.foam-extend.org
# \\/ M anipulation | For copyright notice see file Copyright
# -----------------------------------------------------------------------------
@ -23,7 +23,7 @@
#
# Description
# CMakeLists.txt file for implementing a test harness for the compilation
# and test of foam-extend-4.0 using Kitware CTest/CMake/CDash
# and test of foam-extend-4.1 using Kitware CTest/CMake/CDash
#
# The results will be submitted to the CDash server identified by the file
# CTestConfig.cmake
@ -36,7 +36,7 @@
cmake_minimum_required (VERSION 2.8)
PROJECT(foam-extend-4.0)
PROJECT(foam-extend-4.1)
#-----------------------------------------------------------------------------
# Utility functions
@ -52,13 +52,16 @@ function(GetHostName var)
execute_process(
COMMAND hostname
OUTPUT_VARIABLE thisHostname
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else()
execute_process(
COMMAND hostname -f
OUTPUT_VARIABLE thisHostname
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
set(${var} ${thisHostname} PARENT_SCOPE)
endfunction()
@ -104,9 +107,9 @@ function(GetGitBranchName var)
foreach(branch ${listOfGitBranches})
string(REGEX MATCH "\\* .*$" matchString ${branch})
string(LENGTH "${matchString}" lengthMatchString)
if(lengthMatchString GREATER 0)
# We have match. Cleanup and set retValue
string(REPLACE "* " "" retValue ${matchString})
if(lengthMatchString GREATER 0)
# We have match. Cleanup and set retValue
string(REPLACE "* " "" retValue ${matchString})
endif()
endforeach()
@ -122,7 +125,7 @@ function(GetGitRevNumber var)
set( retValue "unknown")
execute_process(
COMMAND git rev-parse --short=12 HEAD
COMMAND git rev-parse --short=12 HEAD
WORKING_DIRECTORY ${FOAM_ROOT}
OUTPUT_VARIABLE git_rev_number
)
@ -259,11 +262,11 @@ elseif(GIT_FOUND)
if(NOT GIT_ECODE)
# We have a valid git repository.
# Grab the branch and revision info. Add to the build name
GetGitBranchName(GIT_BRANCH_NAME)
# Grab the branch and revision info. Add to the build name
GetGitBranchName(GIT_BRANCH_NAME)
message("Git branch: ${GIT_BRANCH_NAME}")
GetGitRevNumber(GIT_REV_NUMBER)
GetGitRevNumber(GIT_REV_NUMBER)
message("Git revision: ${GIT_REV_NUMBER}")
SET(BUILDNAME "${BUILDNAME}-git-branch=${GIT_BRANCH_NAME}")
@ -301,8 +304,8 @@ elseif(GIT_FOUND)
SET(BUILDNAME "${BUILDNAME}-hg-rev=${GIT_REV_NUMBER}")
else()
# Not a git or mercurial repository: no branch nor revision information available
SET(BUILDNAME "${BUILDNAME}-git-branch=unknown")
SET(BUILDNAME "${BUILDNAME}-git-rev=unknown")
SET(BUILDNAME "${BUILDNAME}-git-branch=unknown")
SET(BUILDNAME "${BUILDNAME}-git-rev=unknown")
endif()
endif()
else()
@ -379,18 +382,18 @@ IF(BUILD_TESTING)
IF(RUN_FROM_ONE_TIMESTEP)
# Modify the cases controlDict file in order to run for only one time step
MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: ${TEST_CASE_DIR}")
if(CMAKE_HOST_WIN32)
if(CMAKE_HOST_WIN32)
# Need to supply a bash shell to run the script under Windows
EXECUTE_PROCESS(
COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}"
WORKING_DIRECTORY .
)
else()
)
else()
EXECUTE_PROCESS(
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}
WORKING_DIRECTORY .
)
endif()
)
endif()
ENDIF(RUN_FROM_ONE_TIMESTEP)
ENDIF(BUILD_TESTING)

View file

@ -10,12 +10,12 @@
# on the foam-extend CDash service hosted on SourceForge.Net
# See here: http://foam-extend.sourceforge.net/CDash/index.php
#
set(CTEST_PROJECT_NAME "foam-extend-4.0")
set(CTEST_PROJECT_NAME "foam-extend-4.1")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "foam-extend.sourceforge.net")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=foam-extend-4.0")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=foam-extend-4.1")
set(CTEST_DROP_SITE_CDASH TRUE)
# We can override those variables for local sites so you can use