[CMake] How to set build configuration when using CDash test scheduling?
Nils Gladitz
gladitz at sci-vis.de
Mon Nov 28 06:30:52 EST 2011
I'm using CDash's (1.8.2) test scheduling and have trouble with a few
tests added with the newer "add_test(NAME ..." signature.
Tests added with the new signature are "Not Run" and I get the following
test output:
Test not available without configuration. (Missing "-C <config>"?)
On a client machine ctest (2.8.6 on windows with Visual Studio 2010)
runs in script mode polling for new test jobs from my CDash instance;
jobs are run with different configurations.
The build configuration gets picked up properly by the build (I assume
"ctest_build" - I can see files in the Debug/Release output directory as
configured via CDash).
What do I have to do so the test command (I assume) "ctest_test" picks
this up as well?
I use the preconfigured client script with an additional
"ctest_empty_binary_directory" before the initial cache gets written:
# From this line down, this script may be customized
# on the Clients tab of the CDash createProject page.
#
if(JOB_MODULE)
set(SOURCE_NAME ${JOB_MODULE})
if(JOB_TAG)
set(SOURCE_NAME ${SOURCE_NAME}-${JOB_TAG})
endif()
else()
set(SOURCE_NAME ${PROJECT_NAME})
if(JOB_BUILDNAME_SUFFIX)
set(SOURCE_NAME ${SOURCE_NAME}-${JOB_BUILDNAME_SUFFIX})
endif()
endif()
set(CTEST_SOURCE_NAME ${SOURCE_NAME})
set(CTEST_BINARY_NAME ${SOURCE_NAME}-bin)
set(CTEST_DASHBOARD_ROOT "${CLIENT_BASE_DIRECTORY}")
set(CTEST_SOURCE_DIRECTORY
"${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY
"${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
set(CTEST_CMAKE_GENERATOR "${JOB_CMAKE_GENERATOR}")
set(CTEST_BUILD_CONFIGURATION "${JOB_BUILD_CONFIGURATION}")
set(CTEST_SITE "${CLIENT_SITE}")
set(CTEST_BUILD_NAME
"${JOB_OS_NAME}-${JOB_OS_VERSION}-${JOB_OS_BITS}-${JOB_COMPILER_NAME}-${JOB_COMPILER_VERSION}")
if(JOB_BUILDNAME_SUFFIX)
set(CTEST_BUILD_NAME ${CTEST_BUILD_NAME}-${JOB_BUILDNAME_SUFFIX})
endif()
if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
set(CTEST_CHECKOUT_COMMAND "svn co ${JOB_REPOSITORY} ${SOURCE_NAME}")
endif()
set(CTEST_UPDATE_COMMAND "svn")
ctest_empty_binary_directory("${CTEST_BINARY_DIRECTORY}")
file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt"
"${JOB_INITIAL_CACHE}")
ctest_start(${JOB_BUILDTYPE})
ctest_update(SOURCE ${CTEST_SOURCE_DIRECTORY})
ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
# The following lines are used to associate a build id with this job.
set(CTEST_DROP_SITE ${JOB_DROP_SITE})
set(CTEST_DROP_LOCATION ${JOB_DROP_LOCATION})
ctest_submit(RETURN_VALUE res)
message("DONE")
Thanks in advance
Nils
More information about the CMake
mailing list