[/
- / Copyright (c) 2003 Boost.Test contributors
+ / Copyright (c) 2003 Boost.Test contributors
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
[h3 I found a bug. Where can I report it?]
You can send a bug report to the boost users' mailing list and/or fill a ticket here [@https://svn.boost.org/trac/boost/].
-
+
[h3 I have a request for a new feature. Where can I ask for it?]
You can send a request to the boost developers' mailing list and/or and/or fill a ticket here [@https://svn.boost.org/trac/boost/].
[h3 How to create test case using the Unit Test Framework?]
To create a test case, use the macro
-
+
__BOOST_AUTO_TEST_CASE__( test_function );
For more details see the Unit Test Framework __BOOST_AUTO_TEST_CASE__ documentation.
[h3 How to create test suite using the Unit Test Framework?]
To create a test suite use the macro
-
+
__BOOST_AUTO_TEST_SUITE__( suite_name );
For more details see the Unit Test Framework __BOOST_AUTO_TEST_SUITE__ documentation.
-
+
[h3 Why did I get a linker error when compiling my test program?]
Boost Test Library components provide several usage variants: to create a test program you can
#include <boost/test/included/unit_test.hpp>
``
-in which case you should not need to link with any precompiled component. Note also that
+in which case you should not need to link with any pre-compiled component. Note also that
you should strictly follow specification on initialization function in other case some compilers may produce linker
error like this.
``
Unresolved external init_unit_test_suite(int, char**).
``
-
+
The reason for this error is that in your implementation you should specify second argument of
`init_unit_test_suite` exactly as in the specification, i.e.: `char* []`.
Suppose, you are building a test module from one translation unit `test_file.cpp`. First, let's do it using the [link boost_test.usage_variants.single_header header-only usage variant] of the __UTF__.
-Let's paste the following content in a `CMakeLists.txt`
+Let's paste the following content in a `CMakeLists.txt`
at the same location than our test file `test_file.cpp`:
[pre
add_test(NAME test1 COMMAND test_executable)
]
-We will now create the build directory for this project (separate directory),
+We will now create the build directory for this project (separate directory),
configure and build the project, as follow:
```
> cd ``$``test_path
-> mkdir build /*< we create a directory dedicated to the build, to avoid
+> mkdir build /*< we create a directory dedicated to the build, to avoid
any pollution of the sources with the temporary
build files >*/
> cd build
> cmake .. /*< configuration of the project >*/
-> cmake --build . /*< this command builds the project, cmake drives a native
+> cmake --build . /*< this command builds the project, cmake drives a native
tool that is configured on the previous command line >*/
> ctest /*< runs the tests declared in the project and prints a report >*/
```
-In the case you are using the [link boost_test.usage_variants.shared_lib shared libraries] variant of __UTF__,
-some modifications should be done in your CMakeLists.txt.
+In the case you are using the [link boost_test.usage_variants.shared_lib shared libraries] variant of __UTF__,
+some modifications should be done in your CMakeLists.txt.
[pre
cmake_minimum_required(VERSION 2.8.11)
> mkdir build /*< we create a directory dedicated to the build, to avoid any pollution of the sources with the temporary
build files >*/
> cd build
-> cmake -DBOOST_ROOT=``$``boost_installation_prefix .. /*< configuration of the project, the `BOOST_ROOT` configuration element indicates the
+> cmake -DBOOST_ROOT=``$``boost_installation_prefix .. /*< configuration of the project, the `BOOST_ROOT` configuration element indicates the
Boost module of `cmake` where to find our installation >*/
-> cmake --build . /*< this command builds the project, cmake drives a native tool that is configured on the
+> cmake --build . /*< this command builds the project, cmake drives a native tool that is configured on the
previous command line >*/
> ctest /*< runs the tests declared in the project and prints a report >*/
```