The doctest test framework works fairly well with Approval Tests.
Doctest is similar to Catch, but claims to give faster compilation times.
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"
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.