Merge branch 'develop' of https://github.com/boostorg/test into develop
# By Andrzej Krzemienski # Via Andrzej Krzemienski (1) and Raffi Enficiaud (1) * 'develop' of https://github.com/boostorg/test: Docs: added stub section for decorators
This commit is contained in:
commit
9031843f92
40
doc/test_organization/decorators.qbk
Normal file
40
doc/test_organization/decorators.qbk
Normal file
@ -0,0 +1,40 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2014 Gennadiy Rozental
|
||||
/
|
||||
/ 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:decorators Decorators]
|
||||
|
||||
[note This is just a stub page. The content will be provided soon...]
|
||||
|
||||
Decorators provide a way to configure certain aspects of a test case, like floating-point precision or required fixtures.
|
||||
|
||||
``
|
||||
#include <boost/test/unit_test.hpp>
|
||||
namespace unittest = boost::unit_test;
|
||||
|
||||
struct MyFixture {
|
||||
MyFixture() {}
|
||||
~MyFixture() {}
|
||||
};
|
||||
|
||||
BOOST_TEST_DECORATOR(
|
||||
+ unittest::fixture<MyFixture>()
|
||||
)
|
||||
__BOOST_AUTO_TEST_CASE__( test_case1 )
|
||||
{
|
||||
BOOST_TEST(true);
|
||||
}
|
||||
``
|
||||
|
||||
Test case `test_case1` is ['decorated] with ['attribute] `fixture`. Just before the test case starts, `MyFixture()` will be called, and just after it finishes, `~MyFixture()` will be called.
|
||||
|
||||
|
||||
[note Decorators are not available in the [link boost_test.users_guide.usage_variants.single_header single-header variant] of the __UTF__.]
|
||||
|
||||
|
||||
[endsect] [/ section decorators]
|
||||
|
||||
[/EOF]
|
@ -37,6 +37,7 @@ In the __UTF__, fixtures can be defined at the test case or the test suite level
|
||||
[include test_suites.qbk]
|
||||
[include expected_failures.qbk]
|
||||
[include fixtures.qbk]
|
||||
[include decorators.qbk]
|
||||
|
||||
[include reference.qbk]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user