Skip to content

Commit

Permalink
BUG: DriverScript: Fix handling of CDash project associated with drop…
Browse files Browse the repository at this point in the history
… site

This commit fixes incorrect use of the variable CTEST_PROJECT_NAME,
it was previously set under the assumption it would be used to select
the CDash project associated with the dashboard submission.

Setting CTEST_PROJECT_NAME was a no-op, it was systematically overridden
with the correct value in CTestConfig. The correct value corresponds to the
name of the top-level CMake project associated with the project being
configured, built and tested.

To address the problem, this commit introduces the variable CDASH_PROJECT_NAME
and use it to ultimately select the appropriate CDash project when
setting the variable CTEST_DROP_LOCATION.

svn-url: http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=27058
git-svn-id: http://svn.slicer.org/Slicer4/trunk@27058 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information
jcfr committed Mar 13, 2018
1 parent 9298c79 commit ad8eefd
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 27 deletions.
19 changes: 7 additions & 12 deletions CMake/SlicerDashboardDriverScript.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -192,23 +192,17 @@ setIfNotDefined(run_ctest_with_upload TRUE)
setIfNotDefined(run_ctest_with_notes TRUE)

#-----------------------------------------------------------------------------
# CTest Project Name
# CDash Project Name
#-----------------------------------------------------------------------------
if(NOT DEFINED Slicer_APPLICATION_NAME)
set(Slicer_APPLICATION_NAME "Slicer")
endif()
list(APPEND variables Slicer_APPLICATION_NAME)
if(NOT DEFINED CTEST_PROJECT_NAME)
set(CTEST_PROJECT_NAME "${Slicer_APPLICATION_NAME}Preview")
if(NOT DEFINED CDASH_PROJECT_NAME)
set(CDASH_PROJECT_NAME "SlicerPreview")
if("${Slicer_RELEASE_TYPE}" STREQUAL "Stable")
set(CTEST_PROJECT_NAME "${Slicer_APPLICATION_NAME}Stable")
# XXX Rename Slicer CDash project
if("${Slicer_APPLICATION_NAME}" STREQUAL "Slicer")
set(CTEST_PROJECT_NAME "Slicer4")
endif()
set(CDASH_PROJECT_NAME "Slicer4")
# set(CDASH_PROJECT_NAME "SlicerStable")
endif()
endif()
list(APPEND variables CTEST_PROJECT_NAME)
list(APPEND variables CDASH_PROJECT_NAME)

#-----------------------------------------------------------------------------
if(NOT DEFINED GIT_REPOSITORY)
Expand Down Expand Up @@ -426,6 +420,7 @@ CMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}")
#-----------------------------------------------------------------------------
file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
${QT_CACHE_ENTRY}
CDASH_PROJECT_NAME:STRING=${CDASH_PROJECT_NAME}
GIT_EXECUTABLE:FILEPATH=${CTEST_GIT_COMMAND}
Subversion_SVN_EXECUTABLE:FILEPATH=${CTEST_SVN_COMMAND}
WITH_COVERAGE:BOOL=${WITH_COVERAGE}
Expand Down
6 changes: 5 additions & 1 deletion CTestConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
set(CTEST_PROJECT_NAME "Slicer")
set(CTEST_NIGHTLY_START_TIME "3:00:00 UTC")

if(NOT DEFINED CDASH_PROJECT_NAME)
set(CDASH_PROJECT_NAME "SlicerPreview")
endif()

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "slicer.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=SlicerPreview")
set(CTEST_DROP_LOCATION "/submit.php?project=${CDASH_PROJECT_NAME}")
set(CTEST_DROP_SITE_CDASH TRUE)

1 change: 1 addition & 0 deletions Extensions/CMake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ option(BUILD_TESTING "Test extensions." ${Slicer_BUILD_TESTING})

option(Slicer_UPLOAD_EXTENSIONS "Build, test, package and upload extensions" OFF)
set(CTEST_DROP_SITE "slicer.cdash.org" CACHE STRING "Dashboard results are uploaded to this URL.")
set(CDASH_PROJECT_NAME "SlicerPreview" CACHE STRING "Name of the dashboard project.")

configure_file(
CTestConfig.cmake.in
Expand Down
2 changes: 1 addition & 1 deletion Extensions/CMake/CTestConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set(CTEST_NIGHTLY_START_TIME "3:00:00 UTC")

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "@CTEST_DROP_SITE@")
set(CTEST_DROP_LOCATION "/submit.php?project=SlicerPreview")
set(CTEST_DROP_LOCATION "/submit.php?project=@CDASH_PROJECT_NAME@")
set(CTEST_DROP_SITE_CDASH TRUE)

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set(expected_defined_vars
CTEST_BUILD_CONFIGURATION
CTEST_CMAKE_GENERATOR
CTEST_DROP_SITE
CDASH_PROJECT_NAME
EXTENSION_BUILD_OPTIONS_STRING
EXTENSION_BUILD_SUBDIRECTORY
EXTENSION_ENABLED
Expand Down Expand Up @@ -113,7 +114,7 @@ set(CTEST_NIGHTLY_START_TIME \"3:00:00 UTC\")
set(CTEST_DROP_METHOD \"http\")
set(CTEST_DROP_SITE \"${CTEST_DROP_SITE}\")
set(CTEST_DROP_LOCATION \"/submit.php?project=SlicerPreview\")
set(CTEST_DROP_LOCATION \"/submit.php?project=${CDASH_PROJECT_NAME}\")
set(CTEST_DROP_SITE_CDASH TRUE)")
endif()
message(STATUS "CTestCustom.cmake has been written to: ${ctestconfig_dest_dir}")
Expand Down
20 changes: 8 additions & 12 deletions Extensions/CMake/SlicerExtensionsDashboardDriverScript.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -285,24 +285,19 @@ setIfNotDefined(run_ctest_with_notes TRUE)
setIfNotDefined(Slicer_UPLOAD_EXTENSIONS TRUE)

#-----------------------------------------------------------------------------
# CTest Project Name
# CDash Project Name
#-----------------------------------------------------------------------------
if(NOT DEFINED Slicer_APPLICATION_NAME)
set(Slicer_APPLICATION_NAME "Slicer")
endif()
list(APPEND variables Slicer_APPLICATION_NAME)
if(NOT DEFINED CTEST_PROJECT_NAME)
set(CTEST_PROJECT_NAME "${Slicer_APPLICATION_NAME}Preview")
if(NOT DEFINED CDASH_PROJECT_NAME)
set(CDASH_PROJECT_NAME "SlicerPreview")
if("${Slicer_RELEASE_TYPE}" STREQUAL "Stable")
set(CTEST_PROJECT_NAME "${Slicer_APPLICATION_NAME}Stable")
# XXX Rename Slicer CDash project
if("${Slicer_APPLICATION_NAME}" STREQUAL "Slicer")
set(CTEST_PROJECT_NAME "Slicer4")
endif()
set(CDASH_PROJECT_NAME "Slicer4")
#set(CDASH_PROJECT_NAME "SlicerStable")
endif()
endif()
list(APPEND variables CTEST_PROJECT_NAME)
list(APPEND variables CDASH_PROJECT_NAME)

#-----------------------------------------------------------------------------
set(CTEST_COMMAND ${CMAKE_CTEST_COMMAND})

if(NOT EXTENSIONS_BUILDSYSTEM_TESTING)
Expand Down Expand Up @@ -494,6 +489,7 @@ macro(run_ctest)
else()

message("Configuring ${CTEST_BINARY_DIRECTORY}/CTestConfig.cmake")
# Require CTEST_DROP_SITE and CDASH_PROJECT_NAME
configure_file(
${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake.in
${CTEST_BINARY_DIRECTORY}/CTestConfig.cmake
Expand Down

0 comments on commit ad8eefd

Please sign in to comment.