Boost logo

Boost Interest :

Subject: Re: [Boost-cmake] Labels for known failures
From: Brad King (brad.king_at_[hidden])
Date: 2009-05-18 11:19:17


troy d. straszheim wrote:
> I've had a fair amount of difficulty getting ctest scripts to work.
> The best I've been able to come up with is
>
> 1. Configure a build space with cmake -DBUILD_REGRESSION_TESTS=ON
> 1a. Customize as necessary
> 2. Run ctest -D Whatever
>
> I've played with having cmake try to configure_file() a ctest script
> into the CMAKE_BINARY_DIR if BUILD_REGRESSION_TESTS is ON, but this has
> been problematic. What is the recommended approach?

The script can be written totally outside the source and build trees.
If written properly it can do the initial checkout and create the build
tree. A standalone script I use to do one of CMake's builds appears below.
You can also create project-specific helper scripts like this one:

   https://vxl.svn.sourceforge.net/svnroot/vxl/trunk/config/cmake/ctest-scripts/
   http://vxl.sourceforge.net/submit-build.html

This makes the individual contributor scripts very small.

-Brad

CMAKE_MINIMUM_REQUIRED(VERSION 2.4)

SET(CTEST_DASHBOARD_ROOT "$ENV{HOME}/Dashboards/My Tests")
SET(CTEST_SITE "hythloth.kitware")
SET(CTEST_BUILD_NAME "Linux64-suncc-5.9")

SET(ENV{CC} "/opt/sun/sunstudio12/bin/cc")
SET(ENV{CXX} "/opt/sun/sunstudio12/bin/CC")
SET(ENV{FC} "/opt/sun/sunstudio12/bin/f90")
SET(ENV{CFLAGS} "")
SET(ENV{CXXFLAGS} "")
SET(ENV{FFLAGS} "")
SET(ENV{LD_LIBRARY_PATH} "/opt/sun/sunstudio12/lib")

SET(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/CMakeSun")
SET(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/CMakeSun-cc-5.9")
SET(CTEST_CVS_COMMAND "/usr/bin/cvs")
SET(CTEST_CONFIGURE_COMMAND "\"${CTEST_SOURCE_DIRECTORY}/bootstrap\"")
SET(CTEST_CMAKE_GENERATOR "Unix Makefiles")
SET(CTEST_BUILD_CONFIGURATION "Debug")
SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")

SET(CTEST_CHECKOUT_COMMAND
   "/usr/bin/cvs -q -z3 -d:pserver:anoncvs_at_[hidden]:/cvsroot/CMake co -d CMakeSun -D yesterday CMake")

CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})

FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
BUILD_TESTING:BOOL=ON
CTEST_TEST_CTEST:BOOL=0
MAKECOMMAND:STRING=/usr/bin/make -i -j2
CMAKE_INSTALL_PREFIX:PATH=${CTEST_BINARY_DIRECTORY}/Tests/TestInstall/Prefix
")

CTEST_START(Nightly)
CTEST_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
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)
CTEST_SUBMIT(RETURN_VALUE res)


Boost-cmake list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk