2
0
mirror of https://github.com/boostorg/test.git synced 2026-02-15 13:32:09 +00:00
Files
test/doc/testing_tools/assertions_severity_levels.qbk
2015-05-25 16:13:21 -04:00

65 lines
2.0 KiB
Plaintext

[/
/ Copyright (c) 2003 Boost.Test team
/
/ 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)
/]
[section:tools_assertion_severity_level Assertion severity level]
Not only __BOOST_TEST__, but all the testing tools are supplied in three flavours/levels, from lowest to highest:
# `WARN`
# `CHECK` and
# `REQUIRE`
For example:
* BOOST_WARN_THROW
* BOOST_CHECK_THROW
* BOOST_REQUIRE_THROW
If an assertion designated by the tool passes, confirmation message can be printed in log output
[footnote to manage what messages appear in the test log stream,
set the proper [link boost_test.test_output.log_runtime_config log level]].
If an assertion designated by the tool failed, depending on the level following will happened
[footnote in some cases log message can be slightly different to reflect failed tool specifics]:
[table:assertions_severity_levels Assertions severity levels
[
[Level]
[Test log content]
[Errors counter]
[Test execution]
]
[
[WARN]
[warning in `<test-case-name>`: condition `<assertion description>` is not satisfied]
[not affected]
[continues]
]
[
[CHECK]
[error in `<test-case-name>`: test `<assertion description>` failed]
[increased]
[continues]
]
[
[REQUIRE]
[fatal error in `<test-case-name>`: critical test `<assertion description>` failed]
[increased]
[aborts]
]
]
[note in the above table, the ['test execution] is related to the current test case ['only]. Hence ['"aborts"] means
that the current test case is aborted, but other test cases in the test tree are still executed.]
Regularly you should use `CHECK` level tools to implement your assertions. You can use `WARN` level tools to validate
aspects less important then correctness: performance, portability, usability etc. You should use `REQUIRE` level
tools only if continuation of the test case doesn't make sense if this assertions fails.
[endsect] [/ assertions severity level]