Boost C++ Libraries Home Libraries People FAQ More

Next

Boost.Test

Gennadiy Rozental

Raffi Enficiaud

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)

Table of Contents

Introduction
Design rationale
How to read this documentation
Usage variants
Declaring and organizing tests
Test cases
Test cases without parameters
Data-driven test cases
Template test cases
Parametrized test cases
Test tree
Test suite
Master test suite
Tests naming
Test tree content
Decorators
Suite-level decorators
Explicit decorator declaration
Fixtures
Fixture models
Test case fixture
Test suite entry/exit fixture
Global fixture
Managing test dependencies
Grouping tests into logical units by labels
Enabling or disabling test unit execution
Adding semantic to a test
Summary of the API for declaring and organizing tests
Writing unit tests
Assertion severity level
BOOST_TEST: universal and general purpose assertions
Reported information
Extended comparisons support
Floating point comparison
Strings and C-strings comparison
Collections comparison
Bitwise comparison
Exception correctness
Time-out for test cases
Expected failures specification
Custom predicate support
Output streams testing tool
BOOST_TEST: details on expressions
Debugging the assertions
Summary of the API for writing tests
Controlling outputs
Tools supports for logging
Logging user defined types
Custom messages
Checkpoints for accurate failure location
Contexts
Logging floating point type numbers
Log formats
Test log output
HRF: Human readable log format
XML log format
JUNIT log format
Report formats
Human readable report format
XML based report output format
Logging API
Log output stream redirection
Log level configuration
Predefined log format selection
Custom log format support
Progress display
Summary of the API for controlling the output
Runtime parameters
Test unit filtering
Custom command line arguments
Summary of run-time parameters
Advanced Usage Scenarios
Building the Unit Test Framework
Test module's entry point
Test module's initialization
Test module runner
Header-only variant customizations
Header-only with multiple translation units
Customizing the module's entry point
Customizing the module's initialization function
Static-library variant customizations
Customizing the module's entry point
Customizing the module's initialization function
Shared-library variant customizations
Customizing the module's entry point
Customizing the module's initialization function
The external test runner usage variant
The obsolete initialization function
Practical usage recommendations
General
IDE usage recommendations
Command line usage recommendations
Tutorials
Test driven development with Boost.Test
A testing framework, what for?
Web Wisdom
Frequently Asked Questions
Glossary
Change log
Acknowledgements
Unit Test Framework API reference
Tests declaration and organization
BOOST_TEST_CASE and BOOST_TEST_CASE_NAME
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE_TEMPLATE
BOOST_TEST_CASE_TEMPLATE
BOOST_TEST_CASE_TEMPLATE_FUNCTION
BOOST_PARAM_TEST_CASE
BOOST_DATA_TEST_CASE
BOOST_DATA_TEST_CASE_F
BOOST_TEST_SUITE
BOOST_AUTO_TEST_SUITE
BOOST_AUTO_TEST_SUITE_END
BOOST_FIXTURE_TEST_CASE
BOOST_FIXTURE_TEST_SUITE
BOOST_GLOBAL_FIXTURE
BOOST_TEST_GLOBAL_FIXTURE
BOOST_TEST_DECORATOR
depends_on (decorator)
description (decorator)
enabled / disabled (decorator)
enable_if (decorator)
fixture (decorator)
label (decorator)
precondition (decorator)
Reference API for writing tests
BOOST_TEST
expected_failures (decorator)
timeout (decorator)
tolerance (decorator)
BOOST_<level>
BOOST_<level>_BITWISE_EQUAL
BOOST_<level>_EQUAL
BOOST_<level>_EQUAL_COLLECTIONS
BOOST_<level>_CLOSE
BOOST_<level>_CLOSE_FRACTION
BOOST_<level>_GE
BOOST_<level>_GT
BOOST_<level>_LE
BOOST_<level>_LT
BOOST_<level>_MESSAGE
BOOST_<level>_NE
BOOST_<level>_PREDICATE
BOOST_<level>_NO_THROW
BOOST_<level>_THROW
BOOST_<level>_EXCEPTION
BOOST_<level>_SMALL
BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES
BOOST_ERROR
BOOST_FAIL
BOOST_IS_DEFINED
BOOST_TEST_TOOLS_UNDER_DEBUGGER
BOOST_TEST_TOOLS_DEBUGGABLE
Controlling tests outputs
BOOST_TEST_CHECKPOINT
BOOST_TEST_PASSPOINT
BOOST_TEST_MESSAGE
BOOST_TEST_INFO
BOOST_TEST_CONTEXT
BOOST_TEST_INFO_SCOPE
BOOST_TEST_DONT_PRINT_LOG_VALUE
Runtime parameters reference
auto_start_dbg
build_info
catch_system_errors
color_output
detect_fp_exceptions
detect_memory_leaks
help
list_content
list_labels
log_format
log_level
log_sink
logger
output_format
random
report_format
report_level
report_memory_leaks_to
report_sink
result_code
run_test
save_pattern
show_progress
use_alt_stack
usage
wait_for_debugger
Build scenarios and behaviors
BOOST_TEST_MAIN
BOOST_TEST_MODULE
BOOST_TEST_ALTERNATIVE_INIT_API
BOOST_TEST_NO_LIB
BOOST_TEST_DYN_LINK
BOOST_TEST_NO_MAIN
BOOST_TEST_GLOBAL_CONFIGURATION
BOOST_TEST_DISABLE_ALT_STACK
Reference
Header <boost/test/data/config.hpp>
Header <boost/test/data/for_each_sample.hpp>
Header <boost/test/data/monomorphic/array.hpp>
Header <boost/test/data/monomorphic/collection.hpp>
Header <boost/test/data/monomorphic/delayed.hpp>
Header <boost/test/data/monomorphic/fwd.hpp>
Header <boost/test/data/monomorphic/generate.hpp>
Header <boost/test/data/monomorphic/generators.hpp>
Header <boost/test/data/monomorphic/generators/keywords.hpp>
Header <boost/test/data/monomorphic/generators/random.hpp>
Header <boost/test/data/monomorphic/generators/xrange.hpp>
Header <boost/test/data/monomorphic/grid.hpp>
Header <boost/test/data/monomorphic/initializer_list.hpp>
Header <boost/test/data/monomorphic/join.hpp>
Header <boost/test/data/monomorphic/singleton.hpp>
Header <boost/test/data/monomorphic/zip.hpp>
Header <boost/test/data/size.hpp>
Header <boost/test/data/test_case.hpp>
Header <boost/test/debug.hpp>
Header <boost/test/debug_config.hpp>
Header <boost/test/detail/global_typedef.hpp>
Header <boost/test/execution_monitor.hpp>
Header <boost/test/framework.hpp>
Header <boost/test/output/compiler_log_formatter.hpp>
Header <boost/test/output/plain_report_formatter.hpp>
Header <boost/test/output/xml_log_formatter.hpp>
Header <boost/test/output/xml_report_formatter.hpp>
Header <boost/test/parameterized_test.hpp>
Header <boost/test/progress_monitor.hpp>
Header <boost/test/results_collector.hpp>
Header <boost/test/results_reporter.hpp>
Header <boost/test/tools/assertion_result.hpp>
Header <boost/test/tools/detail/bitwise_manip.hpp>
Header <boost/test/tools/detail/lexicographic_manip.hpp>
Header <boost/test/tools/detail/per_element_manip.hpp>
Header <boost/test/tools/detail/tolerance_manip.hpp>
Header <boost/test/tools/floating_point_comparison.hpp>
Header <boost/test/tools/output_test_stream.hpp>
Header <boost/test/tree/observer.hpp>
Header <boost/test/tree/test_unit.hpp>
Header <boost/test/unit_test.hpp>
Header <boost/test/unit_test_log.hpp>
Header <boost/test/unit_test_log_formatter.hpp>
Header <boost/test/unit_test_parameters.hpp>
Header <boost/test/utils/algorithm.hpp>
Header <boost/test/utils/is_forward_iterable.hpp>
Header <boost/test/utils/named_params.hpp>

Next