Support for simple program testing, full unit testing, and for program execution monitoring
What is Boost.Test?
Boost.Test is a C++03/11/14/17 unit testing library, available on a wide range of platforms and compilers.
The library is part of Boost. The latest release of the library is available from the boost web site.
Full instructions for use of this library can be accessed from http://www.boost.org/doc/libs/release/libs/test/
Key features
- Easy to get started with:
- download and deflate the latest boost archive
- create a test module with this (header version):
#define BOOST_TEST_MODULE your_test_module #include <boost/test/included/unit_test.hpp>
- Write your first test case:
BOOST_AUTO_TEST_CASE( your_test_case ) { std::vector<int> a{1, 2}; std::vector<int> b{1, 2}; BOOST_TEST( a == b ); }
- build and run
- done
- powerful and unique test assertion macro
BOOST_TEST
, that understands floating points, collections, strings... and uses appropriate comparison paradigm - self-registering test cases, organize cases in test suites, apply fixtures on test cases, suites or globally
- provide assertion context for advanced diagnostic on failure
- powerful and extensible dataset tests
- add decoration to test cases and suites for advanced description, group/label, and dependencies
- powerful command line options and test case filters
- extensible logging, XML and JUNIT outputs for third-party tools (eg. cont. integration)
- various usage (shared/static library/header only) for faster integration and/or compilation/build cycles, smaller binaries
... More
license | BSL-1.0 |
---|---|
project | boost |
url | github.com/boostorg/test |
doc-url | www.boost.org/doc/libs/1_83_0/libs/test |
boost-users@lists.boost.orgMailing list | |
topics | C++Boost |
4 Versions