Releases: approvals/ApprovalTests.cpp
Releases · approvals/ApprovalTests.cpp
Single Hpp File - v.6.0.0
- Breaking changes
- If you pass in a reporter to CombinationApprovals::verifyAllCombinations(), the argument order has changed: see Passing in a Reporter.
- FileApprover::registerComparator() has been renamed to FileApprover::registerComparatorForExtension(), and now returns a Disposable Object. (#42)
- New features
- Support for Existing Catch Project - with your main() (#36)
- CombinationApprovals::verifyAllCombinations() now handles more than 9 parameters in the function being tested. (#33)
- Custom Comparators can be reverted (#42)
- Bug fixes
- None
- Other changes
- doctest 2.3.5 is now supported (2.3.4 remains supported)
Single Hpp File v.5.1.0
- Breaking changes
- None
- New features
- Approval tests will now never launch any reporters on supported Continuous Integration machines
- Approving multiple files in one test
- ExceptionCollector
Approvals::verify(custom_writer)
: see Using custom writersApprovals::verifyWithExtension(object, ".html")
: see Using custom filename extensions
- Bug fixes
- The default namer is now used everywhere
- Other changes
- New documentation:
- All Customizations of Approval Tests
- Utilities
- Writers
- Build Machines and Continuous Integration servers
- Definition of Done - reminders to ourselves, mainly
- Lots more code quality improvements, thanks to @alastairUK
- New documentation:
Single Hpp File
- Breaking changes
- Virtually all code is now in a new
ApprovalTests
namespace, and user code will need to be updated (#5). There are two approaches to updating your code:-
Option 1: Explicitly add
ApprovalTests::
to your code, for example:-Approvals::verify("My objects!"); +ApprovalTests::Approvals::verify("My objects!");
-auto directory = Approvals::useApprovalsSubdirectory("approval_tests"); +auto directory = ApprovalTests::Approvals::useApprovalsSubdirectory("approval_tests");
-
Option 2: Add a
using
directive near the top of your test files:+using namespace ApprovalTests;
-
ApprovalWriter
andApprovalNamer
methods are now const. Any custom implementations of these interfaces will need to be updated. If this causes a problem for custom implementations, please make your data membersmutable
. (#22, #23)- The directory structure of
ApprovalTests/
has been tidied up. This won't affect affect users of the single header download. If you use this project as a sub-module, or have cloned it directly, you will need to update the paths in some of your #includes. However, if you would like help updating your tests, please contact us via the details in the Contributing page. (#17) - We have removed
using std::string;
from all our code. If you happen to have code that worked accidentally because our usings brought instring
, you might need to update your code. - We have removed support for the Okra test framework, as we believe nobody is using the integration, and it was a non-trivial amount of work to get it working again with changes we have made recently.
- Virtually all code is now in a new
- New features
- Enable testing of multiple output files per test.
- Add ability to register a custom namer, to change the naming conventions for approved and received files.
- Add custom namer to put saved and approved files in
approved/
andreceived/
sub-directories. See SeparateApprovedAndReceivedDirectoriesNamer. - Add
[[nodiscard]]
for when compiling with C++17 or newer, so the compiler will point out any uses of disposer objects that are not stored.
- Bug fixes
- Check file streams are valid before using them.
- Other changes
- Adopted Contributor Covenant v1.4
- Implemented some code quality improvements, thanks to @alastairUK
Single Hpp File
- Breaking changes
CombinationApprovals::verifyAllCombinations()
no longer requires the template types to be specified. The changes to allow this have changed the template parameters, so it will cause compilation failures in existing code until they are deleted.
To change the code, simply delete the<....>
from your call. For example:
- CombinationApprovals::verifyAllCombinations<std::vector<std::string>, std::string>(
+ CombinationApprovals::verifyAllCombinations(
[](std::string s){return s + "!";}, words);
- New features
- None
- Bug fixes
- Better support for doctest - this requires doctest 2.3.4 - just released.
- Other changes
- None
Single Hpp File
Single Hpp File
- Breaking changes
- None
- New features
- None
- Bug fixes
- Works on MinGW
- Other changes
- None
Single Hpp File
- Breaking changes
- None
- New features
- Added AutoApproveIfMissingReporter
- Added AutoApproveReporter
- Added a mechanism to shorten the names of output files, by omitting redundant Test Case Names, when using Google Test.
- Started adding hooks for TCR in Catch: (test && commit || revert)
- Bug fixes
- Added virtual destructors for base classes with virtual methods
- Suppress most unused-parameter warnings
- Included
<stdexcept>
forstd::runtime_error
to fix build on Clang 5
- Other changes
- In
ApprovalTestNamer
:- Added
getSourceFileName()
- Added
getOutputFileBaseName()
- Deprecated
getFileName()
- Added
- In
Single Hpp File
- Breaking changes
- Some methods on
DefaultReporter
have moved toDefaultReporterFactory
- Some methods on
- New features
- Added
BlockingReporter
which give the ability to prevent launching on CI machines - Added
MachineBlocker
which gives the ability to have tests that only run on your machine. - Added
Approvals::useAsFrontLoadedReporter()
which gives the ability to use BlockingReporter
- Added
- Bug fixes
- None
- Other changes
- None
Single Hpp File
- Breaking changes
- None
- New features
- Added
Approvals::useApprovalsSubdirectory()
which gives the ability to write approved files to subdirectory - Added
Approvals::useAsDefaultReporter()
which gives the ability to set the default reporter used in your system. - Added
Approvals::verifyExceptionMessage()
which gives the ability to check the text of exception messages StringWriter
now writes a useful message if the file cannot be opened (for example, because the path contains a non-existent directory)
- Added
- Bug fixes
- Reporters will now launch correctly on cygwin, allowing failing tests to be fixed on this platform.
- Other changes
- None
Single Hpp File
- Breaking changes
- None
- New features
- Added converter-based Approvals::verify(object, lambda_converter) overload
- A helpful message is issued if main() is not set up correctly.
- The library is now usable with CMake add_subdirectory() of source tree.
- WinMerge can handle images
- Bug fixes
- Other changes
- Started work on a User Guide: https://github.com/approvals/ApprovalTests.cpp/blob/master/doc/README.md
- Created a Troubleshooting page: https://github.com/approvals/ApprovalTests.cpp/blob/master/doc/Troubleshooting.md