Releases: approvals/ApprovalTests.cpp
Releases · approvals/ApprovalTests.cpp
Single Hpp File - v.8.7.0
See the v.8.7.0 milestone for the full list of changes.
- Breaking changes
- Planned deprecation: The overloads of
verify()
,verifyAll()
andverifyAllCombinations()
which take aReporter
have been deprecated.- The
Reporter
argument is replaced byOptions
- see below. - By default, there is currently no change, but this release marks the start of the plan to remove the deprecated methods.
- The
- If you happen to have specialised
StringUtils::toString()
, you would now need to specializeStringMaker::toString()
instead.- Note: this was previously unsupported behavior, so we are not bumping the major version number.
- Here is how to update your code:
- Planned deprecation: The overloads of
template <>
-std::string ApprovalTests::StringUtils::toString(const StringMakerPrintable& printable)
+std::string ApprovalTests::StringMaker::toString(const StringMakerPrintable& printable)
- New features
- New Scrubber feature for working with non-deterministic output. (#126, thank you @abdulg, @haraldreingruber, @jawn)
- New Options class provides consistent interface for customising the following in all
verify()
,verifyAll()
andverifyAllCombinations()
calls:- Reporter: see Why We Are Converting To Options
- Scrubber: see How to Scrub Non-Deterministic Output
- File extensions now customizable with
verifyAll()
andverifyAllCombinations()
: See File Extensions (#127)
- New mechanics for String conversions (thank you @alepez)
- The class
Approvals
is now an alias forTApprovals< ToStringCompileTimeOptions< StringMaker > >
CombinationApprovals
is now an alias for the classTCombinationApprovals< ToStringCompileTimeOptions<APPROVAL_TESTS_DEFAULT_STREAM_CONVERTER > >
, instead of being a namespace.- This is a completely backwards-compatible feature.
- It has been done to support a new feature in a future release. (#124)
- The class
- Our Conan.io package now supports our Boost.Test integration (#121)
- Bug fixes
- None
- Other changes
- User Guide available on Read the Docs
- This is more easily searchable and better formatted than on GitHub, and a PDF download is available. (#129)
- Documented workarounds for when running Catch2 tests in CLion gives 'unexpected exception' (#131)
- 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.
- All our Macros now start with
- User Guide available on Read the Docs
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 |
Single Hpp File - v.8.6.0
- Breaking changes
- None
- New features
- Add support for Boost.Test framework
See Using Approval Tests With Boost.Test (#41)
- Add support for Boost.Test framework
- Bug fixes
- None
- Other changes
- None
Single Hpp File - v.8.5.0
See the v.8.5.0 milestone for the full list of changes.
- Breaking changes
- None
- New features
- Added support for Sublime Merge on Linux, macOS, and Windows (#103, thank you @jwillikers)
- Added support for Beyond Compare on Linux (#114)
- Added support for custom main() function with doctest: see Existing Project - with your main() (#110, thank you @p-podsiadly)
- Added support for Azure Pipelines, Azure DevOps Server and TFS CI systems (#117)
- Bug fixes
- Other changes
- Updated to doctest 2.3.7 (#108, thank you @p-podsiadly)
- New section in documentation: How-to Guides
- Lots of improvements to our Python release scripts
- Line-length increased from 80 to 90 characters
Single Hpp File - v.8.4.0
- Breaking changes
- None
- New features
- Provide a way to launch reporters in foreground (See #98)
- CI builds now print meaningful differences on failure
- Bug fixes
- None
- Other changes
- None
Single Hpp File - v.8.3.0
- Breaking changes
- None
- New features
CustomReporter::create()
adds flexibility for adding custom merge tools: see How To Use A Custom Reporter (#43)- Add support for Araxis Merge on Mac
- Added support for GitHub Actions CI system - see Build Machines and Continuous Integration servers
- Bug fixes
- Reporters now respect the arguments they are supplied with (#82)
- Other changes
- Document How to Submit a New Reporter to ApprovalTests.
- Lots of refactoring around reporters
- Added
ApprovalTests::FileUtils::readFileThrowIfMissing()
andApprovalTests::FileUtils::readFileReturnEmptyIfMissing()
Single Hpp File - v.8.2.0
See the v.8.2.0 milestone for the full list of changes.
- Breaking changes
- None
- New features
- Conan Integration provided, and documented in Conan Integration (Conan issue 741, thank you @dheater)
- Bug fixes
- 3 locations now throw an exception if their
system()
call failed. Previously they silently ignored the error. (#94, thank you @p-podsiadly)ClipboardReporter
SystemLauncher::launch()
FileUtilsSystemSpecific::copyFile()
- Fixed a bug that could break custom comparators, stopping them from taking effect, depending on how their disposers were stored (#93, thank you @p-podsiadly)
- 3 locations now throw an exception if their
- Other changes
- Windows.h no longer included in SystemUtils.h (#96, thank you @p-podsiadly)
Single Hpp File - v.8.1.1
- Breaking changes
- None
- New features
- None
- Bug fixes
- Boost.UT tests now correctly return non-zero exit status if any Approval Tests failed. (#87)
- Other changes
- Update to Boost.UT commit dde2cba5123444faa82e5c17fcd99f68fe991d89
Single Hpp File - v.8.1.0
See the v.8.1.0 milestone for the full list of changes.
- Breaking changes
- None
- New features
- Added ability to detect ApprovalTests.cpp version in code: see Version detection (#40)
- Bug fixes
- Other changes
Single Hpp File - v.8.0.0
See the v.8.0.0 milestone for the full list of changes.
- Breaking changes
- We have fully standardised the way that Approval Tests looks for 3rd-party headers, so users should no longer need to modify their search paths for include directories. This means that:
- If you are using Catch (#62), and you get build failures, you'll need to change your
#include
lines like this:-#include <catch.hpp> +#include <catch2/catch.hpp>
- If you are using doctest (#68), and you get build failures, you'll need to change your
#include
lines like this:-#include <doctest.h> +#include <doctest/doctest.h>
- If you are using [Boost].UT (#65), and you get build failures, you'll need to change your
#include
lines like this:-#include <ut.hpp> +#include <boost/ut.hpp>
- In order for this to work with our third_party directory, our copies of these header files are now in:
third_party/catch2/include/catch2/
third_party/doctest/include/doctest
third_party/ut/include/boost
- Catch1 is no longer supported as a test framework, in order to better support more CMake build layouts. (#64)
- Catch2 remains fully supported.
- Catch1's main benefit was that it supported pre-C++11 compilers, but as ApprovalTests.cpp requires C++11 or newer, this wasn't useful in practice
- New features
- Greatly improved and documented CMake Integration (#69):
- Approval Tests can now be added to other projects with any of CMake's
add_subdirectory()
,FetchContent
andExternalProject
. (#62, #65, #68, #75, #70, #88, #89) - Created wrapper ApprovalTests.hpp
so that code can work interchangeably with the single header and via CMake integration (#89) - Made CMake targets for targets in third_party consistent with those of the original projects, adding
Catch2::Catch2
,doctest::doctest
andboost.ut
(#70) - Created a namespaced CMake target for ApprovalTests
ApprovalTests::ApprovalTests
(#75) - Don't create third_party targets if they have been created already (#88)
- Approval Tests can now be added to other projects with any of CMake's
- Greatly improved and documented CMake Integration (#69):
- Bug fixes
- Significant effort to improve behaviour with the Ninja build tool:
- Understood, work-around and documented issues with the Ninja generator. See Troubleshooting Misconfigured Build if you have test failures in your Ninja builds. (#74 - thanks @jwillikers)
- Added compile-time checks for GoogleTest, Catch2 and doctest, to detect problems with
__FILE__
macro caused by the Ninja generator on all platforms (#79 - thanks @jwillikers). - Added option to disable the
__FILE__
compile-time check (#86)
- Project now works with Unity builds (#86)
- Significant effort to improve behaviour with the Ninja build tool:
- Other changes
- Updated [Boost].UT integration to work with a change made for the v1.1.5 release of that library. (#66 - thanks @krzysztof-jusiak)
- Code now formatted with clang-format (#39 - thanks @dheater and @alastairUK)
- See Formatting Code to configure your editor to use the .clang-format file automatically.
- Added CI build for clang-cl (#30 - thanks @alastairUK))
- Added CI builds for mingw/MSYS and CygWin (#79)
- Added CI builds for Ninja generator (#74)
- The help text for problem misconfigured
main()
functions now links straight to the relevant help page. (#84)
Single Hpp File - v.7.0.0
See the v.7.0.0 milestone for the full list of changes.
- Breaking changes
- If you are using Catch, we have changed the casing of the file that Approval Tests looks for, to be consistent with Catch downloads (#53). If you get build failures, you'll need to change your
#include
lines like this:-#include "Catch.hpp" +#include "catch.hpp"
- If you pass in a reporter to
CombinationApprovals::verifyAllCombinations()
, the argument order has changed, and is now the first argument: see Passing in a Reporter. (#47 - thanks to @mika-fischer, Mika Fischer)
- If you are using Catch, we have changed the casing of the file that Approval Tests looks for, to be consistent with Catch downloads (#53). If you get build failures, you'll need to change your
- New features
- Support for the [Boost].UT test framework. See Using Approval Tests With [Boost].UT. (#58 - thanks to @lp55, Luiz Paulo M. Pires and @krzysztof-jusiak, Kris Jusiak)
- Support for differencing tools in Tortoise Git. (#57 - thanks to @lp55, Luiz Paulo M. Pires)
- Bug fixes
- Fixed tests failing when using Ninja generator used by Visual Studio 2019 (#55).
- See Troubleshooting Misconfigured Build if you have test failures in your VS2019 builds.
- Fixed unnecessary duplicate static functions. (#54)
- Fixed
ClipboardReporter
on macOS. (#51) Fixed inability to use project as sub-module on windows due to long filenames - by shortening the names of some files and folders in the tests. (#38)
- Fixed tests failing when using Ninja generator used by Visual Studio 2019 (#55).
- Other changes
- Documentation improvements (Thanks to Neil Horlock)
- Updated our copy of Catch to v2.11.0 (from v2.7.1)
- Added GitHub actions (#31 - thanks @alastairUK)