Features
v.x.y.z
v.10.12.0
EmptyFileCreatorByType::registerCreator
Empty file creation is now customizable for individual file extensions.
v.10.11.0
useFileNameSanitizer
You can now customize how invalid filename characters are converted. See Converting Test Names to Valid FileNames
useEmptyFileCreator
Empty file creation is now customizable, for when you are verifying non-text files.
v.10.10.0
Storyboard
Storyboard is a utility that allows you to print the changes to an object over time
Vcpkg Integration
See Vcpkg Integration.
v.10.8.0
Ninja builds work when inside source tree
The entire Misconfigured Builds page of workarounds is no needed, but is retained for those using older releases.
v.10.7.0
CombinationApprovals header
Optional header argument added to CombinationApprovals.
v.10.6.0
FrameworkIntegrations class
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.
Approvals::verify() counts as an assertion in test frameworks
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.
v.10.3.0
Approvals::verifyAll and std::initializer_list
Added std::initializer_list
support to Approvals::verifyAll()
.
For example:
ApprovalTests::Approvals::verifyAll({10, 20, 30});
(See snippet source)
v.10.0.0
Removed Deprecated Code
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
v.8.7.0
Scrubbers
StringMaker and TApprovals
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.
Consistent macro names
All our Macros now start with APPROVAL_TESTS_
.
We have kept the old macros, redirecting to the new ones, for backwards compatibility.
Old |
New |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
v.8.5.0
Support for Sublime Merge
Added support for Sublime Merge on Linux, macOS, and Windows (See #103)
Support for Beyond Compare on Linux
Added support for Beyond Compare on Linux (See #114).
v.8.3.0
Flexibility for adding custom merge tools
CustomReporter::create()
adds flexibility for adding custom merge
tools: see How to Use A Custom
Reporter.
Supporting new merge tools.
v.8.2.0
Conan Integration documented
See Conan Integration.
v.8.1.0
Version detection
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
v.8.0.0
CMake Integration documented
See CMake Integration.
Use with Ninja generator documented
See Troubleshooting Misconfigured Build, for explanations, fixes and workarounds.
v.7.0.0
See the v.7.0.0 milestone for the full list of changes.
Support for [Boost].UT test framework
v.5.1.0
Continuous Integration Builds
Approval tests will now never launch any reporters on supported Continuous Integration machines.
Approving multiple files in one test
ExceptionCollector
Using custom writers
Using custom filename extensions
v.5.0.0
Multiple output files per test
SeparateApprovedAndReceivedDirectoriesNamer
Registering a Custom Namer
Before v.5.0.0
Customizing Google Tests Approval File Names
Blocking Reporter
Machine Blockers
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 snippet source)