- v.x.y.z
- v.10.12.0
- v.10.11.0
- v.10.10.0
- v.10.9.0
- v.10.8.0
- v.10.7.0
- v.10.6.0
- v.10.5.0
- v.10.4.0
- v.10.3.0
- v.10.2.0
- v.10.1.1
- v.10.0.0
- v.8.9.0
- v.8.8.0
- v.8.7.0
- v.8.6.0
- v.8.5.0
- v.8.3.0
- v.8.2.0
- v.8.1.0
- v.8.0.0
- v.7.0.0
- v.6.0.0
- v.5.1.0
- v.5.0.0
- Before v.5.0.0
Empty file creation is now customizable for individual file extensions.
You can now customize how invalid filename characters are converted. See Converting Test Names to Valid FileNames
Empty file creation is now customizable, for when you are verifying non-text files.
Storyboard is a utility that allows you to print the changes to an object over time
Grid is a utility that creates 2D text in a grid format
See Vcpkg Integration.
Options now has the ability to specify a custom namer.
The entire Misconfigured Builds page of workarounds is no needed, but is retained for those using older releases.
Optional header argument added to CombinationApprovals.
We now have a centralised portal, FrameworkIntegrations
, to all the places that you need to use, in order
to add support for a new test framework.
Previously, Approvals wouldn't register as an assertion, giving misleading messages and reporting, and sometimes causing a test framework to complain that there were no assertions.
See How to Select a Reporter with an Environment Variable.
See Using Approval Tests With CppUTest.
Added std::initializer_list
support to Approvals::verifyAll()
.
For example:
ApprovalTests::Approvals::verifyAll({10, 20, 30});
See DateUtils
See Why We Are Converting To Options for easy ways to update your code.
Specifically, the following have been removed:
- Methods
Approvals::verify(..., Reporter)
Approvals::verifyAll(..., Reporter)
Approvals::verifyExistingFile(..., Reporter)
Approvals::verifyExceptionMessage(..., Reporter)
Approvals::verifyWithExtension(...)
CombinationApprovals::verifyAllCombinations(Reporter, ...)
- Macros
APPROVAL_TESTS_HIDE_DEPRECATED_CODE
APPROVALTESTS_VERSION
APPROVALTESTS_VERSION_MAJOR
APPROVALTESTS_VERSION_MINOR
APPROVALTESTS_VERSION_PATCH
APPROVALTESTS_VERSION_STR
APPROVALS_CATCH_DISABLE_FILE_MACRO_CHECK
See Scrubbing using Regular Expressions (regex).
See How to Use the Fmt Library To Print Objects.
See Options.
See How to Scrub Non-Deterministic Output.
This is in internal change, which will provide future flexibility, and does not change any existing code.
In this release, we:
- templatized the Approvals class, renaming it to TApprovals
- changed the CombinationApprovals namespace to a template class called TCombinationApprovals
- introduced the StringMaker class as an additional customization point for the above two classes
To learn about the extra string-formatting options for your objects, see To String.
All our Macros now start with APPROVAL_TESTS_
.
We have kept the old macros, redirecting to the new ones, for backwards compatibility.
Old | New |
---|---|
APPROVALTESTS_VERSION |
APPROVAL_TESTS_VERSION |
APPROVALTESTS_VERSION_MAJOR |
APPROVAL_TESTS_VERSION_MAJOR |
APPROVALTESTS_VERSION_MINOR |
APPROVAL_TESTS_VERSION_MINOR |
APPROVALTESTS_VERSION_PATCH |
APPROVAL_TESTS_VERSION_PATCH |
APPROVALTESTS_VERSION_STR |
APPROVAL_TESTS_VERSION_STR |
APPROVALS_CATCH_DISABLE_FILE_MACRO_CHECK |
APPROVAL_TESTS_DISABLE_FILE_MACRO_CHECK |
See Using Approval Tests With Boost.Test
Added support for Sublime Merge on Linux, macOS, and Windows (See #103)
Added support for Beyond Compare on Linux (See #114).
CustomReporter::create()
adds flexibility for adding custom merge tools: see How to Use A Custom Reporter.
See How to Submit a New Reporter to ApprovalTests.
See Conan Integration.
ApprovalTests provides the following macros to detect the release version, with a set of example values shown in italics:
APPROVAL_TESTS_VERSION_MAJOR
: 8APPROVAL_TESTS_VERSION_MINOR
: 1APPROVAL_TESTS_VERSION_PATCH
: 2APPROVAL_TESTS_VERSION_STR
: 8.1.2APPROVAL_TESTS_VERSION
: 80102
See CMake Integration.
See Troubleshooting Misconfigured Build, for explanations, fixes and workarounds.
See the v.7.0.0 milestone for the full list of changes.
See Using Approval Tests With [Boost].UT.
See Existing Project - with your main().
Approval tests will now never launch any reporters on supported Continuous Integration machines.
See Approving multiple files in one test
See Using custom filename extensions
See Multiple output files per test.
See SeparateApprovedAndReceivedDirectoriesNamer
See Registering a Custom Namer
See Using Approval Tests With Google Tests
Sometimes you will want tests to only run on certain machines. Machine blockers are a great way to do this.
TEST_CASE("Only run this test on John's machine")
{
auto blocker = ApprovalTests::MachineBlocker::onMachinesNotNamed("JOHNS_MACHINE");
if (blocker.isBlockingOnThisMachine())
{
return;
}
// Write tests here that depend on John's environment.
REQUIRE(ApprovalTests::SystemUtils::getMachineName() == "JOHNS_MACHINE");
}
See Using sub-directories for approved files