Skip to content

Latest commit

 

History

History
52 lines (33 loc) · 1.55 KB

UsingDoctest.md

File metadata and controls

52 lines (33 loc) · 1.55 KB

Using Approval Tests With doctest

Contents

Getting Started With doctest

The doctest test framework works fairly well with Approval Tests.

Doctest is similar to Catch, but claims to give faster compilation times.

New Project

Create a file main.cpp and add just the following two lines:

// main.cpp:
#define APPROVALS_DOCTEST // This tells Approval Tests to provide a main() - only do this in one cpp file
#include "ApprovalTests.hpp"

snippet source

Limitations

Currently, Approval Tests overrides any --reporter command-line argument supplied. This is needed for Approval Tests to function with doctest. The Approval Tests reporter works like doctest's console reporter. This means that it is not possible to run Approval Tests with the doctest test framework, and use reporters such as xml.

We currently do not have a better workaround.


Back to User Guide