Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 2.57 KB

UsingBoostTest.md

File metadata and controls

67 lines (47 loc) · 2.57 KB

Using Approval Tests With Boost.Test

Contents

Getting Started With Boost.Test

The Boost.Test test framework works well with Approval Tests.

Note: this document assumes the reader is familiar with the Boost.Test framework.

Requirements

Approval Tests for Boost.Test requires that you specify the #include <.../unit_test.hpp>
This allows ApprovalTests to work with all the different configurations of boost.

Approval Tests needs Boost.Test version 1.60.0 or above.

Adding ApprovalTests to your Boost.Test

To enable any Boost.Test test files to use ApprovalTests, find the corresponding entry point and
add the following lines of code to your Test module's entry point after the boost headers:

// test_entry_point.cpp file[s] (after #including boost.test)
#define APPROVALS_BOOSTTEST
#include "ApprovalTests.hpp"

snippet source | anchor

Understanding Boost.Test Entry points

A directory of Boost.Test source files can either have multiple or a single entry point[s]. The entry point is any file that will contain the line:

#define BOOST_TEST_MODULE ModuleName

snippet source | anchor


Back to User Guide