Skip to content

Commit

Permalink
Cleaning up ctest site identification.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ward Fisher committed Feb 2, 2015
1 parent fc97546 commit 444bf7a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
32 changes: 21 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,16 @@ IF(ENABLE_TESTS)
SET(NC_CTEST_DROP_SITE "my.cdash.org" CACHE STRING "Dashboard location for CTest-based testing purposes.")
SET(NC_CTEST_DROP_LOC_PREFIX "" CACHE STRING "Prefix for Dashboard location on remote server when using CTest-based testing.")

FIND_PROGRAM(HOSTNAME_CMD NAMES hostname)
IF(HOSTNAME_CMD)
EXEC_PROGRAM(${HOSTNAME_CMD} ARGS "-s" OUTPUT_VARIABLE HOSTNAME)
SET(NC_CTEST_SITE "${HOSTNAME}" CACHE STRING "Hostname of test machine.")
ENDIF()

IF(NC_CTEST_SITE)
SET(SITE "${NC_CTEST_SITE}" CACHE STRING "")
ENDIF()

# Create a CTestConfig file from the template.
CONFIGURE_FILE("${netCDF_SOURCE_DIR}/CTestConfig.cmake.in"
"${netCDF_SOURCE_DIR}/CTestConfig.cmake"
Expand Down Expand Up @@ -997,9 +1007,9 @@ MACRO(add_bin_env_temp_large_test prefix F)
ADD_TEST(${prefix}_${F} bash "-c" "TEMP_LARGE=${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${prefix}_${F}")
IF(MSVC)
SET_PROPERTY(TARGET ${prefix}_${F} PROPERTY FOLDER "tests")
SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
${CMAKE_CURRENT_BINARY_DIR})
Expand Down Expand Up @@ -1031,9 +1041,9 @@ MACRO(build_bin_test F)
SET_TARGET_PROPERTIES(${F}
PROPERTIES LINK_FLAGS_DEBUG " /NODEFAULTLIB:MSVCRT"
)
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
${CMAKE_CURRENT_BINARY_DIR})
Expand All @@ -1046,12 +1056,12 @@ MACRO(add_bin_test_no_prefix F)
ADD_TEST(${F} ${EXECUTABLE_OUTPUT_PATH}/${F})
IF(MSVC)
SET_PROPERTY(TEST ${F} PROPERTY FOLDER "tests/")
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
${CMAKE_CURRENT_BINARY_DIR})
${CMAKE_CURRENT_BINARY_DIR})
ENDIF()
ENDMACRO()

Expand All @@ -1061,9 +1071,9 @@ MACRO(build_bin_test_no_prefix F)
ADD_TEST(${F} ${EXECUTABLE_OUTPUT_PATH}/${F})
IF(MSVC)
SET_PROPERTY(TEST ${F} PROPERTY FOLDER "tests/")
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
${CMAKE_CURRENT_BINARY_DIR})
Expand All @@ -1089,9 +1099,9 @@ MACRO(add_bin_test prefix F)
ADD_TEST(${prefix}_${F} ${EXECUTABLE_OUTPUT_PATH}/${prefix}_${F})
IF(MSVC)
SET_PROPERTY(TEST ${prefix}_${F} PROPERTY FOLDER "tests/")
SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
${CMAKE_CURRENT_BINARY_DIR})
Expand Down
3 changes: 2 additions & 1 deletion CTestConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ set(DART_TESTING_TIMEOUT "4800")

set(CTEST_PROJECT_NAME "@NC_CTEST_PROJECT_NAME@")
set(CTEST_NIGHTLY_START_TIME "02:00:00 EDT")
SET(CTEST_SITE "@NC_CTEST_SITE@")

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "@NC_CTEST_DROP_SITE@")
set(CTEST_DROP_SITE "@NC_CTEST_DROP_SITE@")
set(CTEST_DROP_LOCATION "@NC_CTEST_DROP_LOC_PREFIX@/submit.php?project=@NC_CTEST_PROJECT_NAME@")
set(CTEST_DROP_SITE_CDASH TRUE)

0 comments on commit 444bf7a

Please sign in to comment.