Boost logo

Boost Test Library

"Test everything that could possibly break"

XP maxim

Introduction
Components

Execution monitor
Program Execution Monitor
Test Tools
Test Execution Monitor
Unit Test Framework
Minimal Test

FAQ
Design

Release notes
Open Issues
Portability
Acknowledgements

Introduction

The Boost Test Library provides a matched set of components for writing test programs, organizing tests in to simple test cases and test suites, and controlling their runtime execution. The Program Execution Monitor is also useful in some production (non-test) environments.

reference to the top

Components

  • Execution Monitor - a basic exception and error detection and reporting facility for use in both production and test programs. The Execution Monitor calls a user-supplied function and reports all caught runtime exceptions. It is used internally by other Boost Test Library components. It also could be used in some production environment to make controlled calls of functions which might otherwise crash the program.
  • Program Execution Monitor - a simple helper facility to be used to monitor a program execution. The Program Execution Monitor provides the main() function and uses the Execution Monitor to control a program execution. It should be used in production environment to produce uniform error reports. To control programs working in test environment, use the Test Execution Monitor instead.
  • Test Execution Monitor - causes a test program to run in a monitored environment. The Test Execution Monitor provides the main() function to control a simple test program execution and allows to use the Test Tools to implement test logic. It is intended to be used in test environment. To control production code execution use the Program Execution Monitor.
  • Unit Test Framework - a framework that simplifies writing and organizing test cases. The framework supports test cases written as simple free functions or member functions and organizes them into a tree of test suites. The framework allows to use the Test Tools to implement a test cases and provides a facility to manage a log report level and a result report level.
  • Minimal testing - simple facility designed to provide the functionality provided before by the original version of Boost Test. The same as the Test Execution Monitor it causes the test program to run in a monitored environment. In addition it defines several simple test tools that behave similarly to ones defined in Test Tools. Minimal testing facility does not require linking with external components, so could be a component of choice for simple and quick testing needs.
reference to the top

FAQ

See Boost Test Library FAQ.

Design

See Boost Test Library Design.

Release notes

  • Facility for automatic registration of unit tests is introduced
  • XML log format is introduced
  • XML report format is introduced
  • BOOST_CHECK_NO_THROW test tool is introduced
  • BOOST_BITWISE_CHECK test tool is introduced
  • libraries file names changed
  • Components examples and test documentation page is introduced
  • Catch system errors switch introduced
  • MS C runtime debug hooks introduced

For more details see complete release notes

reference to the top

Open Issues

  • What dependencies will we tolerate in Boost Test Library? Also we need means to overcome this restriction for extensions.
  • Memory usage test tools.
  • Performance test tools.
  • Facilities to allow testing of template function for the provided type list.
  • How to implement compilability checks.
  • Selective test cases run: ways to define by user and notify the framework.
  • Support for the testing of multithreaded programs.
  • Make BOOST_TEST_CLOSE print values properly
  • Timeout implementation on Win32 platform.
  • Need to separate reference and tutorial material
  • Unit Test Framework extension should be documented
reference to the top

Portability

Because the Boost Test Library is critical for porting and testing Boost libraries, it has been written to be extremely conservative in its use of C++ features, and to keep dependencies to a bare minimum.

Tests have been run (and work) under numerous compilers.

Acknowledgements

Original Test Library:

Ed Brey, Kevlin Henney, Ullrich Koethe, and Thomas Matelich provided very helpful comments during development. Dave Abrahams, Ed Brey, William Kempf, Jens Maurer, and Wilka suggested numerous improvements during the Formal Review. Jens Maurer was the review manager. Beman Dawes is the developer and maintainer.

Second Release:

Beman Dawes and Ullrich Koethe started the library. Fernando Cacciola, Jeremy Siek, Beman Dawes, Ullrich Koethe, Dave Abrahams suggested numerous improvements during the Formal Review. Jeremy Siek was the review manager. Dave reference to the top Abrahams edited this documentation. Beman Dawes was a great help in both final testing and merging library with rest of the boost. Gennadiy Rozental is the developer and maintainer.