Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Test Cases

BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES
BOOST_AUTO_TEST_CASE_TEMPLATE
BOOST_FIXTURE_TEST_CASE
BOOST_GLOBAL_FIXTURE
BOOST_PARAM_TEST_CASE
BOOST_PARAM_CLASS_TEST_CASE
BOOST_TEST_CASE
BOOST_TEST_CASE_TEMPLATE
BOOST_TEST_CASE_TEMPLATE_FUNCTION

A test case is a named body of code providing the three phases of a test: setup, exercise and verify. A test case is most conveniently created using one of the provided test case macros listed in the following table.

Table 1.1. Test Case Macros

Macro

Description

BOOST_AUTO_TEST_CASE(name)

Creates test case name and automatically registers it with the test runner.

BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(name, count)

Informs the test runner that test case name should result in count failures.

BOOST_AUTO_TEST_CASE_TEMPLATE(name, T, types)

Automatically registers a test case name parameterized by the template argument T over the collection of types.

BOOST_FIXTURE_TEST_CASE(name, fixture)

Creates test case name derived from the fixture fixture and automatically registers it with the test runner.

BOOST_PARAM_TEST_CASE(fn, begin, end)

Manually creates a parameterized test case using the supplied callable object fn and parameter iterators begin and end.

BOOST_PARAM_CLASS_TEST_CASE(fn, instance, begin, end)

Manually creates a parameterized test case using the supplied callable object fn, class instance instance and parameter iterators begin and end.

BOOST_TEST_CASE(fn)

Manually creates a test case using the supplied callable object fn.

BOOST_TEST_CASE_TEMPLATE(name, types)

Manually creates a set of test cases from the template test case name for each type in types.

BOOST_TEST_CASE_TEMPLATE_FUNCTION(name, T)

Manually creates a template test case name parameterized by the template argument T.



PrevUpHomeNext