[CMake] CTest / CDash integration

Johannes Zarl johannes.zarl at jku.at
Wed Apr 10 11:07:48 EDT 2013


Probably someone else can give you a better answer, but I ended up doing the 
following:

ctest \
  --build-and-test "$SOURCE_DIR" "$BUILD_DIR" \
  --build-generator "Unix Makefiles" --build-makeprogram make \
  -j "$PARALLEL_JOBS" \
  --build-options -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_C_COMPILER="$CC" \
  --test-command ctest -D Nightly

I.e. the CTEST_SOURCE_DIRECTORY and CTEST_BINARY_DIRECTORY variables are set
by the "--build-and-test sourcedir builddir" argument, and the build options 
are only needed to pass extra variables to your build system.

HTH,
  Johannes

On Wednesday, 10. April 2013, 16:09:10, Martin Baute wrote:
> Sorry, but I have to keep complaining about the documentation. Please
> excuse the ranting.
> 
> Just one example from the manual:
> 
>     ctest --build-options: Add extra options to the build step.
>     This option must be the last option with the exception of
> --test-command
> 
> End of available information.
> 
> I have not been able to figure out which CTEST_* variable these options
> end up in, or how I could make them actually *affect* the build.
> 
> I am also still looking for a reference of variables used by CTest.
> 
> Quite obviously it is required to set both CTEST_SOURCE_DIRECTORY and
> CTEST_BINARY_DIRECTORY in your script, as CTest keeps telling you if
> you
> try to execute an empty script. I wonder if it wouldn't be easier if
> CTest
> would assume the current directory as BINARY_DIR and the script
> directory
> as SOURCE_DIR by default, but that might be just me.
> 
> That I have to set CTEST_COMMAND manually when I obviously just called
> the
> executable, conveniently passing a working invocation in argv[0]).
> Strange.
> 
> CTEST_SITE / CTEST_BUILD_NAME constitute the identification sent to the
> CDash server, as I found out perusing some example scripts on the Wiki,
> none of which really explaining what is done. Nice, but why ain't I
> told
> in plain English?
> 
> As SVN user, I have to set CTEST_CHECKOUT_COMMAND myself (to something
> resembling "svn checkout ${MY_REPOSITORY} ${CTEST_SOURCE_DIRECTORY}".
> Figured it out, works. But apparently CTEST_UPDATE_COMMAND is something
> else entirely, as CTest insists on appending "update --non-interactive"
> on its own accord...
> 
> It is possible to trial & error your way around all this, but I would
> REALLY prefer to have a reference list, telling me which features I
> might
> be missing, or how I should escape quotation marks and semicolons in a
> -DCMAKE_PREFIX_PATH= statement. Or why a statement that works when
> given
> as CTEST_CONFIGURE_COMMAND fails when passed in ctest_configure(
> OPTIONS ).
> 
> Hence, again my question: Is the man page and the half-dozen pages in
> the
> Wiki really all there is in freely available documentation on CTest?
> 
> Regards,



More information about the CMake mailing list