Changes between Initial Version and Version 1 of CMakeTestCompileFail


Ignore:
Timestamp:
Jun 12, 2007, 3:11:07 AM (15 years ago)
Author:
Douglas Gregor
Comment:

Initial documentation for boost_test_compile_fail

Legend:

Unmodified
Added
Removed
Modified
  • CMakeTestCompileFail

    v1 v1  
     1= CMake Macro Reference: `boost_test_compile_fail` =
     2
     3The `boost_test_compile_fail` macro creates a Boost regression test that will be compiled,
     4but compilation should fail. It is used to test, e.g., that certain
     5disallowed syntax does in fact cause a compilation failure.
     6
     7{{{
     8boost_test_compile_fail(testname
     9                        [source1]
     10                        [COMPILE_FLAGS compileflags])
     11}}}
     12
     13`testname` is the name of the test. `source1` is the name of the source
     14file that will be built. If no source file is provided, the file
     15"testname.cpp" will be used instead.
     16
     17The `COMPILE_FLAGS` argument provides additional arguments that will
     18be passed to the compiler when building this test.
     19
     20== Example ==
     21The following invocation of the `boost_test_compile_fail` macro introduces a regression test that will attempt to compile `function_test_fail1.cpp`. The compilation should produce some error messages, in which case the regression test has succeeded.
     22
     23{{{
     24boost_test_compile_fail(function_test_fail1)
     25}}}
     26
     27This example is from [http://svn.boost.org/svn/boost/sandbox-branches/boost-cmake/boost_1_34_0/libs/function/test/CMakeLists.txt libs/function/test/CMakeLists.txt].
     28
     29== Where Defined ==
     30This macro is defined in the Boost Testing module in [http://svn.boost.org/svn/boost/sandbox-branches/boost-cmake/boost_1_34_0/tools/build/CMake/BoostTesting.cmake tools/build/CMake/BoostTesting.cmake]