]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | / Copyright (c) 2015 Boost.Test contributors | |
3 | / | |
4 | / Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | /] | |
7 | ||
8 | [section:test_tools_support_for_logging Tools supports for logging] | |
9 | ||
10 | ||
11 | [/ -------------------------------------------------------------------------------------------------- ] | |
12 | [section:testing_tool_output_disable Logging user defined types] | |
13 | ||
14 | Most of the [link boost_test.testing_tools testing tools] print values of their | |
15 | arguments to the output stream in some form of log statement. If arguments type does not support | |
16 | `` | |
17 | operator<<(std::ostream&, ArgumentType const&); | |
18 | `` | |
19 | interface you will get a compilation error. You can either implement above interface or prohibit | |
20 | the [link boost_test.testing_tools testing tools] from logging argument values for | |
21 | specified type. To do so, use following statement on file level before first test case that | |
22 | includes statement failing to compile: | |
23 | ||
24 | `` | |
25 | BOOST_TEST_DONT_PRINT_LOG_VALUE(ArgumentType) | |
26 | `` | |
27 | ||
28 | [bt_example example32..BOOST_TEST_DONT_PRINT_LOG_VALUE usage..run-fail] | |
29 | ||
30 | [endsect] [/section:testing_tool_output_disable] | |
31 | ||
32 | [/ -------------------------------------------------------------------------------------------------- ] | |
33 | [section:test_output_macro_message Custom messages] | |
34 | The macro __BOOST_TEST_MESSAGE__ is intended to be used for the purpose of injecting an additional message into the | |
35 | __UTF__ test log. These messages are not intended to indicate any error or warning conditions, but rather as | |
36 | information/status notifications. The macro signature is as follows: | |
37 | ||
38 | __BOOST_TEST_MESSAGE__(test_message); | |
39 | ||
40 | The test_message argument can be as simple as C string literal or any custom expression that you can produce with in a | |
41 | manner similar to standard `std::iostream` operation. | |
42 | ||
43 | [important Messages generated by this tool do not appear in test log output with default value of the active log level | |
44 | threshold. For these messages to appear the active log level threshold has to be set to a value below or equal | |
45 | to "message". | |
46 | ] | |
47 | ||
48 | [bt_example example21..__BOOST_TEST_MESSAGE__ usage..run] | |
49 | ||
50 | [endsect] [/section:test_output_macro_message] | |
51 | ||
52 | [/ -------------------------------------------------------------------------------------------------- ] | |
53 | ||
54 | [include checkpoints.qbk] | |
55 | [include contexts.qbk] | |
56 | [include logging_floating_point.qbk] | |
57 | ||
58 | [endsect] [/ Tools supports for logging] |