Boost logo

Boost :

From: Brad King (brad.king_at_[hidden])
Date: 2007-05-08 10:26:15


Jürgen Hunold wrote:
> -CTest does not support "failed" tests (aka compile-fail, link-fail, run-fail)

Sure it does. See the SET_TESTS_PROPERTIES command:

  http://www.cmake.org/HTML/Documentation.html

it has a WILL_FAIL property and others to specify regular expressions to
match in the test output to indicate failure or passing.

> -CTest does not support "compile" and "link" only tests.

For a compile-only test just add the objects to a static library. This
will just archive them without really linking:

  ADD_LIBRARY(mycompiletest STATIC compile_only.cpp)

How does a "link only" test work? Where does it get the object files
without compiling? If you do have them somewhere, you can list them as
sources and CMake will just link them:

  ADD_EXECUTABLE(mylinktest /path/to/linkable.obj)

Note that in the above examples the tests are actually added with
ADD_TEST commands in the main project and the above code appears in
CMakeLists.txt files in test directories. This can be packaged up in a
macro that writes everyting needed to disk at CMake configuration time.

-Brad


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk