| 1 | = CMake Macro Reference: `boost_test_compile` = |
| 2 | |
| 3 | The `boost_test_compile` macro creates a Boost regression test that will be compiled, |
| 4 | but not linked or executed. If the test can be compiled with no |
| 5 | errors, the test passes. |
| 6 | |
| 7 | {{{ |
| 8 | boost_test_compile(testname |
| 9 | [source1] |
| 10 | [COMPILE_FLAGS compileflags]) |
| 11 | }}} |
| 12 | |
| 13 | `testname` is the name of the test. `source1` is the name of the source |
| 14 | file that will be built. If no source file is provided, the file |
| 15 | "testname.cpp" will be used instead. |
| 16 | |
| 17 | The `COMPILE_FLAGS` argument provides additional arguments that will |
| 18 | be passed to the compiler when building this test. |
| 19 | |
| 20 | == Example == |
| 21 | The following invocation of the `boost_test_compile` macro defines a regression test named `advance` that attempts to compile `advance.cpp`. If compilation succeeds, the regression test passes. |
| 22 | |
| 23 | {{{ |
| 24 | boost_test_compile(advance) |
| 25 | }}} |
| 26 | |
| 27 | This example is from [http://svn.boost.org/svn/boost/sandbox-branches/boost-cmake/boost_1_34_0/libs/mpl/test/CMakeLists.txt libs/mpl/test/CMakeLists.txt]. |
| 28 | |
| 29 | == Where Defined == |
| 30 | This 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] |