- Introduction
- Test Framework Requirements
- Steps to add support
- Examples
- Adding new framework to documentation
ApprovalTests.cpp is designed to work with multiple C++ test frameworks.
If your test framework is not already supported, this section offers help to add that support.
ApprovalTests.cpp can be made to work with any test framework that supplies the following:
- The current test's name
- The current test's source file (with correct case of filename)
- Ability to report unexpected exceptions as test failures
- Provide some code to add to the test's
main()function, to list out for the running of test cases - Give that code a
TestNameinstance, that will store information about the test being executed - As each test case starts, update the
TestNameinstance with details of the source file name, and test case name - Ideally, provide a mechanism (such as a macro) that makes it easy for users to use this code in their own tests
This is perhaps best understood by reviewing the implementations for frameworks that are already supported - see /ApprovalTests/integrations/.
The following lines can be ignored in the above files - they are for this project's release process:
// <SingleHpp unalterable>
// </SingleHpp>- Add a new file about the customisation, such as UsingCatch
- Record the new framework support in:
- The Help message in ApprovalTestNamer.h
- GettingStarted - see "Details" list, and "Choosing a testing framework"
- User Guide - see "Test Frameworks" section
- Other documentation links: see Definition of Done