
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/
#define BOOST_TEST_MODULE your_test_module
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE( your_test_case ) {
std::vector<int> a{1, 2};
std::vector<int> b{1, 2};
BOOST_TEST( a == b );
}
BOOST_TEST, that understands floating points, collections, strings... and uses appropriate comparison paradigmCopyright 2001-2014, Gennadiy Rozental.
Copyright 2013-2020, Boost.Test team.
Distributed under the Boost Software License, Version 1.0.
(Get a copy at www.boost.org/LICENSE_1_0.txt)
Please read this document to get started.
Boost.Test uses mostly the facility provided by our wonderful Boost testers (column Tests below).
| Branch | Deps | Docs | Tests | Github Actions |
|---|---|---|---|---|
master |
||||
develop |
<p><img src="doc/html/images/boost.test.logo.png" alt="boosttest logo" /></p> <h1>What is Boost.Test?</h1> <p>Boost.Test is a C++03/11/14/17 unit testing library, available on a wide range of platforms and compilers.</p> <p>The library is part of <a href="http://www.boost.org">Boost</a>. The latest release of the library is available from the boost web site.</p> <p>Full instructions for use of this library can be accessed from http://www.boost.org/doc/libs/release/libs/test/</p> <h1>Key features</h1> <ul> <li>Easy to get started with: <ol> <li>download and deflate the latest boost archive</li> <li>create a test module with this (header version): <pre class="highlightjs highlight"><code class="language- hljs">#define BOOST_TEST_MODULE your_test_module #include <boost/test/included/unit_test.hpp> </code></pre> </li> <li>Write your first test case: <pre class="highlightjs highlight"><code class="language- hljs">BOOST_AUTO_TEST_CASE( your_test_case ) { std::vector<int> a{1, 2}; std::vector<int> b{1, 2}; BOOST_TEST( a == b ); } </code></pre> </li> <li>build and run</li> <li>done</li> </ol> </li> <li>powerful and unique test assertion macro <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/testing_tools/boost_test_universal_macro.html"><code>BOOST_TEST</code></a>, that understands floating points, collections, strings... and uses appropriate comparison paradigm</li> <li>self-registering test cases, organize cases in test suites, apply fixtures on test cases, suites or globally</li> <li>provide assertion <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/test_output/test_tools_support_for_logging/contexts.html">context</a> for advanced diagnostic on failure</li> <li>powerful and extensible <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/test_cases/test_case_generation.html">dataset</a> tests</li> <li>add <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/decorators.html">decoration</a> to test cases and suites for <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/semantic.html">advanced description</a>, <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/tests_grouping.html">group/label</a>, and <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/tests_dependencies.html">dependencies</a></li> <li>powerful command line options and test case filters</li> <li>extensible logging, XML and JUNIT outputs for third-party tools (eg. cont. integration)</li> <li>various usage (shared/static library/header only) for faster integration and/or compilation/build cycles, smaller binaries</li> </ul> <h1>Copyright and license</h1> <p>Copyright 2001-2014, Gennadiy Rozental.<br/> Copyright 2013-2020, Boost.Test team.</p> <p>Distributed under the Boost Software License, Version 1.0.<br/> (Get a copy at www.boost.org/LICENSE_1_0.txt)</p> <h1>Contribute</h1> <p>Please read <a href="CONTRIBUTE.md">this document</a> to get started.</p> <h1>Build Status</h1> <p>Boost.Test uses mostly the facility provided by our wonderful Boost testers (column <code>Tests</code> below).</p> <table> <thead> <tr> <th align="center">Branch</th> <th align="left">Deps</th> <th align="left">Docs</th> <th align="left">Tests</th> <th align="left">Github Actions</th> </tr> </thead> <tbody> <tr> <td align="center"><a href="https://github.com/boostorg/test/tree/master"><code>master</code></a></td> <td align="left"><a href="https://pdimov.github.io/boostdep-report/master/test.html"><img src="https://img.shields.io/badge/deps-master-brightgreen.svg" alt="Deps" /></a></td> <td align="left"><a href="http://www.boost.org/doc/libs/master/doc/html/test.html"><img src="https://img.shields.io/badge/docs-master-brightgreen.svg" alt="Documentation" /></a></td> <td align="left"><a href="http://www.boost.org/development/tests/master/developer/test.html"><img src="https://img.shields.io/badge/matrix-master-brightgreen.svg" alt="Enter the Matrix" /></a></td> <td align="left"><a href="https://github.com/boostorg/test/actions"><img src="https://github.com/boostorg/test/workflows/CI/badge.svg?branch=master" alt="Build Status" /></a></td> </tr> <tr> <td align="center"><a href="https://github.com/boostorg/test/tree/develop"><code>develop</code></a></td> <td align="left"><a href="https://pdimov.github.io/boostdep-report/develop/test.html"><img src="https://img.shields.io/badge/deps-develop-brightgreen.svg" alt="Deps" /></a></td> <td align="left"><a href="http://www.boost.org/doc/libs/develop/doc/html/test.html"><img src="https://img.shields.io/badge/docs-develop-brightgreen.svg" alt="Documentation" /></a></td> <td align="left"><a href="http://www.boost.org/development/tests/develop/developer/test.html"><img src="https://img.shields.io/badge/matrix-develop-brightgreen.svg" alt="Enter the Matrix" /></a></td> <td align="left"><a href="https://github.com/boostorg/test/actions"><img src="https://github.com/boostorg/test/workflows/CI/badge.svg?branch=develop" alt="Build Status" /></a></td> </tr> </tbody> </table>
<p><img src="doc/html/images/boost.test.logo.png" alt="boosttest logo" /></p> <h1>What is Boost.Test?</h1> <p>Boost.Test is a C++03/11/14/17 unit testing library, available on a wide range of platforms and compilers.</p> <p>The library is part of <a href="http://www.boost.org">Boost</a>. The latest release of the library is available from the boost web site.</p> <p>Full instructions for use of this library can be accessed from http://www.boost.org/doc/libs/release/libs/test/</p> <h1>Key features</h1> <ul> <li>Easy to get started with: <ol> <li>download and deflate the latest boost archive</li> <li>create a test module with this (header version): <pre class="highlightjs highlight"><code class="language- hljs">#define BOOST_TEST_MODULE your_test_module #include <boost/test/included/unit_test.hpp> </code></pre> </li> <li>Write your first test case: <pre class="highlightjs highlight"><code class="language- hljs">BOOST_AUTO_TEST_CASE( your_test_case ) { std::vector<int> a{1, 2}; std::vector<int> b{1, 2}; BOOST_TEST( a == b ); } </code></pre> </li> <li>build and run</li> <li>done</li> </ol> </li> <li>powerful and unique test assertion macro <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/testing_tools/boost_test_universal_macro.html"><code>BOOST_TEST</code></a>, that understands floating points, collections, strings... and uses appropriate comparison paradigm</li> <li>self-registering test cases, organize cases in test suites, apply fixtures on test cases, suites or globally</li> <li>provide assertion <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/test_output/test_tools_support_for_logging/contexts.html">context</a> for advanced diagnostic on failure</li> <li>powerful and extensible <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/test_cases/test_case_generation.html">dataset</a> tests</li> <li>add <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/decorators.html">decoration</a> to test cases and suites for <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/semantic.html">advanced description</a>, <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/tests_grouping.html">group/label</a>, and <a href="http://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/tests_organization/tests_dependencies.html">dependencies</a></li> <li>powerful command line options and test case filters</li> <li>extensible logging, XML and JUNIT outputs for third-party tools (eg. cont. integration)</li> <li>various usage (shared/static library/header only) for faster integration and/or compilation/build cycles, smaller binaries</li> </ul> <h1>Copyright and license</h1> <p>Copyright 2001-2014, Gennadiy Rozental.<br/> Copyright 2013-2020, Boost.Test team.</p> <p>Distributed under the Boost Software License, Version 1.0.<br/> (Get a copy at www.boost.org/LICENSE_1_0.txt)</p> <h1>Contribute</h1> <p>Please read <a href="CONTRIBUTE.md">this document</a> to get started.</p> <h1>Build Status</h1> <p>Boost.Test uses mostly the facility provided by our wonderful Boost testers (column <code>Tests</code> below).</p> <table> <thead> <tr> <th align="center">Branch</th> <th align="left">Deps</th> <th align="left">Docs</th> <th align="left">Tests</th> <th align="left">Github Actions</th> </tr> </thead> <tbody> <tr> <td align="center"><a href="https://github.com/boostorg/test/tree/master"><code>master</code></a></td> <td align="left"><a href="https://pdimov.github.io/boostdep-report/master/test.html"><img src="https://img.shields.io/badge/deps-master-brightgreen.svg" alt="Deps" /></a></td> <td align="left"><a href="http://www.boost.org/doc/libs/master/doc/html/test.html"><img src="https://img.shields.io/badge/docs-master-brightgreen.svg" alt="Documentation" /></a></td> <td align="left"><a href="http://www.boost.org/development/tests/master/developer/test.html"><img src="https://img.shields.io/badge/matrix-master-brightgreen.svg" alt="Enter the Matrix" /></a></td> <td align="left"><a href="https://github.com/boostorg/test/actions"><img src="https://github.com/boostorg/test/workflows/CI/badge.svg?branch=master" alt="Build Status" /></a></td> </tr> <tr> <td align="center"><a href="https://github.com/boostorg/test/tree/develop"><code>develop</code></a></td> <td align="left"><a href="https://pdimov.github.io/boostdep-report/develop/test.html"><img src="https://img.shields.io/badge/deps-develop-brightgreen.svg" alt="Deps" /></a></td> <td align="left"><a href="http://www.boost.org/doc/libs/develop/doc/html/test.html"><img src="https://img.shields.io/badge/docs-develop-brightgreen.svg" alt="Documentation" /></a></td> <td align="left"><a href="http://www.boost.org/development/tests/develop/developer/test.html"><img src="https://img.shields.io/badge/matrix-develop-brightgreen.svg" alt="Enter the Matrix" /></a></td> <td align="left"><a href="https://github.com/boostorg/test/actions"><img src="https://github.com/boostorg/test/workflows/CI/badge.svg?branch=develop" alt="Build Status" /></a></td> </tr> </tbody> </table>