Correction for a problem with newer versions of CMake that are refusing to upload the test harness

results  to the CDash server.
The generated error message is the following: "Error message was: Illegal characters found in URL"

Diagnostic:
    If the environment variable CDASH_SUBMIT_LOCAL_HOST_ID is not initialized, the FQN hostname of the
system will be picked by the CMake/CTest scripts. The CTest internal system command used for retrieving
the FQN hostname is indeed leaving a carriage return in the returned hostname string.
That string is in turn reused to construct an URL that will be shared with the CDash service. The presence
of such characters (\n and \r) is no longer accepted by newer versions of CTest/CMake.

Solution:
    The solution is simply to check and remove such characters from the hostname string.
This commit is contained in:
Martin Beaudoin 2018-04-15 21:51:43 -04:00
parent afef1bac2f
commit 2adbd0457a
3 changed files with 32 additions and 22 deletions

View file

@ -1,7 +1,7 @@
# /*-------------------------------------------------------------------------*\ # /*-------------------------------------------------------------------------*\
# ========= | # ========= |
# \\ / F ield | foam-extend: Open Source CFD # \\ / 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 # \\ / A nd | Web: http://www.foam-extend.org
# \\/ M anipulation | For copyright notice see file Copyright # \\/ M anipulation | For copyright notice see file Copyright
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@ -23,7 +23,7 @@
# #
# Description # Description
# CMakeLists.txt file for implementing a test harness for the compilation # 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 # The results will be submitted to the CDash server identified by the file
# CTestConfig.cmake # CTestConfig.cmake
@ -36,7 +36,7 @@
cmake_minimum_required (VERSION 2.8) cmake_minimum_required (VERSION 2.8)
PROJECT(foam-extend-4.0) PROJECT(foam-extend-4.1)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Utility functions # Utility functions
@ -59,6 +59,11 @@ function(GetHostName var)
OUTPUT_VARIABLE thisHostname OUTPUT_VARIABLE thisHostname
) )
endif() endif()
# Cleanup possible presence of \n or \r characters
string(REPLACE "\n" "" thisHostname ${thisHostname})
string(REPLACE "\r" "" thisHostname ${thisHostname})
set(${var} ${thisHostname} PARENT_SCOPE) set(${var} ${thisHostname} PARENT_SCOPE)
endfunction() endfunction()

View file

@ -1,7 +1,7 @@
# /*-------------------------------------------------------------------------*\ # /*-------------------------------------------------------------------------*\
# ========= | # ========= |
# \\ / F ield | foam-extend: Open Source CFD # \\ / 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 # \\ / A nd | Web: http://www.foam-extend.org
# \\/ M anipulation | For copyright notice see file Copyright # \\/ M anipulation | For copyright notice see file Copyright
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@ -23,7 +23,7 @@
# #
# Description # Description
# CMakeLists.txt file for implementing a test harness for the compilation # 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 # The results will be submitted to the CDash server identified by the file
# CTestConfig.cmake # CTestConfig.cmake
@ -36,7 +36,7 @@
cmake_minimum_required (VERSION 2.8) cmake_minimum_required (VERSION 2.8)
PROJECT(foam-extend-4.0) PROJECT(foam-extend-4.1)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Utility functions # Utility functions
@ -59,6 +59,11 @@ function(GetHostName var)
OUTPUT_VARIABLE thisHostname OUTPUT_VARIABLE thisHostname
) )
endif() endif()
# Cleanup possible presence of \n or \r characters
string(REPLACE "\n" "" thisHostname ${thisHostname})
string(REPLACE "\r" "" thisHostname ${thisHostname})
set(${var} ${thisHostname} PARENT_SCOPE) set(${var} ${thisHostname} PARENT_SCOPE)
endfunction() endfunction()

View file

@ -10,12 +10,12 @@
# on the foam-extend CDash service hosted on SourceForge.Net # on the foam-extend CDash service hosted on SourceForge.Net
# See here: http://foam-extend.sourceforge.net/CDash/index.php # 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_NIGHTLY_START_TIME "01:00:00 UTC")
set(CTEST_DROP_METHOD "http") set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "foam-extend.sourceforge.net") 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) set(CTEST_DROP_SITE_CDASH TRUE)
# We can override those variables for local sites so you can use # We can override those variables for local sites so you can use