Native ApprovalTests for C++ on Linux, Mac and Windows

Overview

Approval Tests for C++

Build status Actions Status Python tests Documentation Status License Contributor Covenant ConanCenter package

⬇️ Download the latest version (v.10.8.0) of the single header file here.

📖 Read the Docs

Contents

What are Approval Tests?

Also known as Golden Master Tests or Snapshot Testing, Approval Tests are an alternative to asserts. If you are unfamiliar with them, we have an overview and a tutorial.

They are great for testing objects with lots of fields, or lists of objects.

Requirements

Getting Started

ToString (ostream insertion)

Often, you will need to create functions to allow objects to print their state. This is commonly done with an ostream << operator. You can find examples here: To String

What's new?

Check out the Features page or upcoming release notes to see what we've been working on lately, or browse the past release notes.

Feedback

If you have any comment or suggestion on this documentation, please email Llewellyn or Clare via the details in the Contributing page.

Comments
  • Document Ninja Generator Issue

    Document Ninja Generator Issue

    Documentation is buried and lacking about a critical bug when using the Ninja generator. Any test framework integration, such as Catch2, that uses the __FILE__ macro to locate Approval Test source files will fail when using Ninja. This is not only for MSVC as referenced in the current documentation but for any time the Ninja generator is used. I recently started to use the Ninja generator for all of my builds, so was caught unaware of this issue when using LLVM's Clang with Ninja on macOS. It should also be noted that the Ninja generator is not a problem when using Boost ut because it uses std::source_location instead of the __FILE__ macro. I tested this successfully just to be sure. If this bug is documented before the troubleshooting page, perhaps in the pages on the effected test frameworks, user's may avoid this issue entirely.

    documentation infrastructure 
    opened by jwillikers 26
  • Tests fail when using Ninja generator (in VS2019)

    Tests fail when using Ninja generator (in VS2019)

    CMake in VS2019 seems to default to using the Ninja generator.

    If I build with this and run the tests I get exceptions thrown.

    1: Catch1_Tests.exe is a Catch v1.12.1 host application. 1: Run with -? for options 1: 1: ------------------------------------------------------------------------------- 1: YouCanVerifyText 1: ------------------------------------------------------------------------------- 1: ..\..\..\tests\Catch1_Tests\ApprovalsTests.cpp(6) 1: ............................................................................... 1: 1: ..\..\..\tests\Catch1_Tests\ApprovalsTests.cpp(6): FAILED: 1: due to unexpected exception with message: 1: Unable to write file: ..\..\..\tests\Catch1_Tests\ApprovalsTests. 1: YouCanVerifyText.received.txt 1: 1: =============================================================================== 1: test cases: 1 | 1 failed 1: assertions: 1 | 1 failed

    If I use the Visual Studio 2019 generator then all seems fine

    bug 
    opened by alastairUK 21
  • Provide a way to select the Reporter at run-time

    Provide a way to select the Reporter at run-time

    I’d really like to remove the need to edit and recompile to change the reporter used, probably by providing a command-line argument to do so.

    We could base the option names on the reporter classes, with the Reporter suffix removed.

    Examples that spring to mind:

    -r BeyondCompareReporter
    --reporter Quiet
    -r Clipboard
    -r AutoApprove
    -r ‘C:\path to my program\...exe’
    -r ‘mydifftool -1 {received} -2 {approved} &’
    -r ‘someconsolediff {received} {approved}’
    

    We would want to control whether the tool runs in the foreground or background, if it launches another process.

    enhancement reporters 
    opened by claremacrae 19
  • Move only disposer

    Move only disposer

    Description

    I came across this problem when writing an utility method, which registers the same comparator for multiple file extensions: link.

    In linked code, Disposer class wraps a vector of ComparatorDisposer objects. Each ComparatorDisposer is created by FileApprover::registerComparatorForExtension, copied to a vector and destructed and at that point the comparator is immediately disposed.

    Expected behavior is that the comparator is disposed once the copy in the vector is destructed. Destructor of the original ComparatorDisposer instance should not dispose the comparator.

    The solution

    I've added a flag isActive, which is initially set to true. The flag is set to false when a ComparatorDisposer is moved-from, to indicate that it's destructor should not restore previousComparator.

    Additionally, I've declared copy constructor as deleted.

    opened by p-podsiadly 15
  • Change Catch2 includes to catch2/catch.hpp

    Change Catch2 includes to catch2/catch.hpp

    From the current maintainer of Catch2, after we announced we had changed from Catch.hpp to catch.cpp:

    "I strongly recommend going with #include "catch2/catch.hpp"

    Because if you use Catch2 via CMake or having it installed, the include path will be <catch2/catch.hpp>"

    bug infrastructure 
    opened by claremacrae 15
  • Increase the number of collections in `verifyAllCombinations` beyond 9

    Increase the number of collections in `verifyAllCombinations` beyond 9

    Currently, the number of collections in verifyAllCombinations is limited to 9, and is extensible by code by the user of the library. Some legacy code has functions with more than 9 parameters, sometimes many more. It would be more convenient if the user didn't have to write the extension themselves. This issue suggests to increase the number of collections that the library can support natively, ideally without limit, by using variadic templates. If I'm not mistaken, Clare already mentioned this could be an evolution for the library. This issue is then to log this request. Keep up the amazing work! :)

    enhancement breaking_change 
    opened by joboccara 15
  • Try speeding up CI builds

    Try speeding up CI builds

    Feedback is painfully slow from our Travis and AppVeyor CI builds now:

    • Travis: 40 - 45 minutes elapsed time
      • 13 configurations - each taking 3 to 4 minutes
    • AppVeyor - 18 minutes
      • Cygwin: 11 minutes
      • Mingw 7.5 minutes
      • Some of the pain here is the queue time, which is probably outside our control
    infrastructure 
    opened by claremacrae 13
  • Naming of targets in third_party is non-standard

    Naming of targets in third_party is non-standard

    If the Catch2 project is included via CMake's add_subdirectory() or FetchContent, then the following targets are created, as far as I can tell:

    • Catch2
    • Catch2::Catch2

    Unfortunately I didn't appreciate the significance of this when creating third_party/catch2/CMakeLists.txt - which creates the target catch

    The name Catch2::Catch2 is preferred, as if that is missing, a warning is issued when CMake runs, making it easier to track down missing dependencies.

    I think it should be possible to create aliases in the CMake files in third_party to retain the old naming, in case any users are already depending on the third_party target-names I created earlier.

    bug infrastructure 
    opened by claremacrae 13
  • F!! [Boost].UT test framework integration support

    F!! [Boost].UT test framework integration support

    Hi,

    This is the initial implementation of the [Boost].UT test framework integration support, developed alongside @claremacrae I see that I still have to build the tests for the approval tests of the integration with the test framework :) But please take a look to see if anything else is missing and if there are changes needed for what's been done.

    enhancement 
    opened by lp55 12
  • Project does not compile with Clang

    Project does not compile with Clang

    When I try to compile the ApprovalTests.cpp project with Clang, I receive this error message:

    In file included from /Users/arh/code/ApprovalTests.cpp/src/ApprovalTests_Catch2_Tests/CombinationTests.cpp:8:
    /Users/arh/code/ApprovalTests.cpp/src/ApprovalTests/../ApprovalTests/CombinationApprovals.h:102:58: error: call to function 'operator<<' that is neither visible in the template definition nor found by argument-dependent lookup
                                                s << ") => " << result << '\n';
                                                             ^
    

    Clang is actually correct here, and the problem is that gcc and msvc accept incorrect code. The situation is described in detail at http://clang.llvm.org/compatibility.html#dep_lookup and the second example describes exactly the case in ApprovalTests.

    There are two obvious ways to make the problem go away quickly:

    1. Put the operator<< overload in CombinationTests.cpp inside the std namespace, so that it can be found by ADL in the verifyAllCombinations function template. Unfortunately this is illegal, as we're only allowed to put full specializations in to the std namespace.
    2. Predeclare the operator<< overload before including the CombinationApprovals.h header.

    This Godbolt example contains a minimal example: https://godbolt.org/z/nReFWZ

    I'm probably going outside the scope of this Issue now, but I believe a better approach would be to provide a customization point that allows users to provide custom string conversions for their own types, or for types that do not easily support a stream insertion operator. Sometimes third-party types do provide a stream insertion operator, but its output isn't acceptable for some reason. In those cases, it's helpful to have a separate mechanism for stringifying the type.

    The Catch2 library has a nice mechanism for this: https://github.com/catchorg/Catch2/blob/master/docs/tostring.md The Boost unit test library does it too: https://www.boost.org/doc/libs/1_68_0/libs/test/doc/html/boost_test/test_output/test_tools_support_for_logging/testing_tool_output_disable.html

    Neither of those implementations could be described as 'trivial', but I think that some form of customization point that goes beyond requiring an operator<< overload would be advantageous for ApprovalTests.cpp.

    Whilst looking in to this, I found a useful reference on best practices for providing customization points: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4381.html

    bug 
    opened by aharrison24 12
  • Use namespace instead of class Approvals

    Use namespace instead of class Approvals

    All classes should be put inside namespace. And the class Approvals should be removed since it is just a collection of static functions. They should be free functions inside the namespace.

    The name of the namespace should be ideally ApprovalTests. Downstream users would then use

    ApprovalTests::verify(...);
    
    enhancement breaking_change 
    opened by dimztimz 12
  • Bump egor-tensin/setup-cygwin from 3 to 4

    Bump egor-tensin/setup-cygwin from 3 to 4

    Bumps egor-tensin/setup-cygwin from 3 to 4.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump DoozyX/clang-format-lint-action from 0.14 to 0.15

    Bump DoozyX/clang-format-lint-action from 0.14 to 0.15

    Bumps DoozyX/clang-format-lint-action from 0.14 to 0.15.

    Release notes

    Sourced from DoozyX/clang-format-lint-action's releases.

    v0.15

    Commits
    • c3b2c94 Merge pull request #48 from kalabukdima/master
    • 7cd7220 Merge pull request #49 from SK83RJOSH/master
    • acc83cb Support clang-format 15
    • a69aedf Colorize output in github action
    • 33bcef1 Merge pull request #46 from heisencoder/master
    • 2e526c4 Update examples in README.md with latest version
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump actions/checkout from 2 to 3.1.0

    Bump actions/checkout from 2 to 3.1.0

    Bumps actions/checkout from 2 to 3.1.0.

    Release notes

    Sourced from actions/checkout's releases.

    v3.1.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v3.0.2...v3.1.0

    v3.0.2

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v3...v3.0.2

    v3.0.1

    v3.0.0

    • Updated to the node16 runtime by default
      • This requires a minimum Actions Runner version of v2.285.0 to run, which is by default available in GHES 3.4 or later.

    v2.4.2

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v2...v2.4.2

    v2.4.1

    • Fixed an issue where checkout failed to run in container jobs due to the new git setting safe.directory

    v2.4.0

    • Convert SSH URLs like org-<ORG_ID>@github.com: to https://github.com/ - pr

    v2.3.5

    Update dependencies

    v2.3.4

    v2.3.3

    ... (truncated)

    Changelog

    Sourced from actions/checkout's changelog.

    v3.1.0

    v3.0.2

    v3.0.1

    v3.0.0

    v2.3.1

    v2.3.0

    v2.2.0

    v2.1.1

    • Changes to support GHES (here and here)

    v2.1.0

    v2.0.0

    v2 (beta)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Catch2 integration does not handle Generators inside sections

    Catch2 integration does not handle Generators inside sections

    Per Catch2 documentation:

    GENERATE can be seen as an implicit SECTION, that goes from the place GENERATE is used, to the end of the scope. [...] The fact that GENERATE introduces a virtual SECTION can also be used to make a generator replay only some SECTIONs, without having to explicitly add a SECTION

    I looked into the Catch2 integration and it seems like the Catch2 API does not include generator information as part of the sector:

    // Approvals/integrations/catch/Cathc2Approvals.h
    
    struct Catch2TestCommitRevert : Catch::TestEventListenerBase
    {
        ...
        virtual void sectionStarting(Catch::SectionInfo const& sectionInfo) override
        {
            currentTest.sections.push_back(sectionInfo.name); // Name here does not include the generator value
        }
        ...
    };
    

    In fact, if you look at the Catch::SectionInfo type it only includes name and source location. I'm no expert on the Catch2 internals but at first glance, I would say Catch2 generators are handled more like part of the body of a section rather than variants of the parent section (Like generated tests cases in other frameworks).

    The result of this behavior is that if you run an approval inside a section with a generator, the approval is uniquely registered for the section rather than each generated variant of the section, resulting in approval failures following the execution of the different variants of the section:

    enum class Keyword
    {
        Unknown, Foo, Bar, Quux
    };
    
    Keyword parseKeyword(const std::string_view word);
    
    SECTION("Verify our parsing algorithm works with the most relevant words in the vocabulary of a programmer")
    {
         const std::string_view word = GENERATE("foo", "bar", "quux");
         Approvals::verify(parseKeyword(word)); // If we approve "foo", it fails in the next iteration of the generator
    }
    
    opened by Manu343726 1
  • with CppUTest: `ApprovalMismatchException` suppresses other tests output

    with CppUTest: `ApprovalMismatchException` suppresses other tests output

    see example here

    the example shows a test file that has two failing tests - one of them is using approvals, the other is a non-approvals test.

    expected

    both failures should be shown

    actual

    the non-approvals test output is not seen in the terminal

    opened by nitsanavni 4
Releases(v.10.12.2)
  • v.10.12.2(Feb 25, 2022)

  • v.10.12.1(Nov 23, 2021)

  • v.10.12.0(Sep 8, 2021)

  • v.10.11.0(Sep 2, 2021)

    • Breaking changes
      • None
    • New features
    • Bug fixes
      • None
    • Other changes
      • Add a copyright statement to the released single header (#189)
      • All code snippets in documentation include the ApprovalTests:: qualification, so example code can be copied and pasted more easily. (#115)
    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.10.11.0.hpp(194.60 KB)
  • v.10.10.0(Aug 17, 2021)

  • v.10.9.1(Apr 30, 2021)

  • v.10.9.0(Apr 30, 2021)

    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.10.9.0.hpp(187.17 KB)
  • v.10.8.0(Feb 15, 2021)

  • v.10.7.1(Feb 9, 2021)

  • v.10.7.0(Jan 25, 2021)

  • v.10.6.0(Dec 17, 2020)

    • Breaking changes
      • None
    • New features
      • Approvals::verify() counts as an assertion in test frameworks. (#148)
        • This works in all currently-supported 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.
      • FrameworkIntegrations class
    • Bug fixes
      • None
    • Other changes
      • None
    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.10.6.0.hpp(170.17 KB)
  • v.10.5.1(Dec 7, 2020)

    • Breaking changes
      • None
    • New features
      • None
    • Bug fixes
    • Other changes
      • Update Boost.ut integration to work with latest version of that library.
        (A change after Boost.ut v1.1.8 resulted in a build error - this is now fixed)
      • GitHub Actions CI build added for our Python code (#165)
      • VS2017 Debug x64 build of ApprovalTests.cpp.StarterProject gave "C1128: number of sections exceeded object file format limit: compile with /bigobj" (ApprovalTests.cpp.StarterProject#16)
      • Removed undocumented ability to verify std::wstring and wchar_t*. This gave compiler warnings on C++17 and above, and did not work on Visual Studio. (#154, which contains the deleted code for future reference)
    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.10.5.1.hpp(167.66 KB)
  • v.10.5.0(Nov 3, 2020)

  • v.10.4.0(Oct 19, 2020)

  • v.10.3.0(Aug 13, 2020)

    • Breaking changes

      • None
    • New features

      • Add initializer_list support to Approvals::verifyAll() (#152, thanks @alepez)
        For example:
            Approvals::verifyAll({10, 20, 30});
      
    • Bug fixes

      • None
    • Other changes

      • Overloads of Approvals::verifyAll() that previously only accepted std::vector now accept all container types (#152, thanks @alepez)
      • Better readability of the groups of member methods on Read the Docs, for example in Approving Objects (#153)
    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.10.3.0.hpp(152.72 KB)
  • v.10.2.1(Aug 7, 2020)

    Note: because DateUtilities is brand-new and barely used, we are releasing this as a patch release, to properly convey risk.

    • Breaking changes
      • time_t DateUtilities::toUTC(std::tm& timeinfo) renamed to DateUtilities::toUtc()
    • New features
      • Added tm DateUtilities::toUtc(time_t& tt)
    • Bug fixes
      • Fix Visual Studio compiler warning C4996 due to use of gmtime() (#150)
        • This also fixes the Visual Studio builds of the Starter Project, which failed to compile due to the C4996 warning being treated as an error
    • Other changes
      • None
    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.10.2.1.hpp(151.33 KB)
  • v.10.2.0(Aug 5, 2020)

    • Breaking changes
      • None
    • New features
      • Add DateUtils to easily create and print dates. See DateUtils
    • Bug fixes
      • Fix infinite loop with empty regex (#147)
    • Other changes
      • Visual Studio improvements in ApprovalTests.cpp.StarterProject:
        • Visual Studio 2017: Fix build failures in several configurations (#12)
        • Visual Studio 2017: Add Tutorial.cpp (#14)
        • Visual Studio 2019: Add build files for Visual Studio 2019 (#13)
        • Build all VS 2017 and VS 2019 configurations in GitHub actions (#15)
    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.10.2.0.hpp(151.15 KB)
  • v.10.1.2(Jul 10, 2020)

    • Breaking changes
      • None
    • New features
      • None
    • Bug fixes
      • Fix confusing compiler error messages when porting to Options (#140)
      • Add help message to top of release header, to help when misconfigured main gives missing symbols (#144)
    • Other changes
    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.10.1.2.hpp(148.58 KB)
  • v.10.1.1(Jun 25, 2020)

  • v.10.1.0(Jun 22, 2020)

  • v.10.0.1(Jun 6, 2020)

  • v.10.0.0(Jun 4, 2020)

    DON'T PANIC!

    We expect most of our users to have no problem with this upgrade. Changes are only needed when:

    1. you are passing in a specific reporter, which is usually an infrequent and temporary coding state,
    2. you call verifyWithExtension(object, ".json") is now
      Approvals::verify(object, Options().fileOptions().withFileExtension(".json"))

    Removing verify(..., Reporter)

    This is the fourth and final of a series of rapid releases, to make small steps in deprecating passing in a Reporter object, in favor of an Options object, to the verify*() methods. See Why We Are Converting To Options for easy ways to update your code.

    1. deprecation warnings are off: users can opt-in (v.8.7.0)
    2. deprecation warnings are on: users can opt-out (v.8.9.1)
    3. deprecation warnings are forced, code still exists (v.8.9.2)
    4. the deprecated methods are hidden: users can opt-in (v.9.0.0)
    5. the deprecated methods are removed (v.10.0.0) <== you are here
    • Breaking changes

      • Removed methods:
        • Approvals::verify(..., Reporter)
        • Approvals::verifyAll(..., Reporter)
        • Approvals::verifyExistingFile(..., Reporter)
        • Approvals::verifyExceptionMessage(..., Reporter)
        • Approvals::verifyWithExtension(...)
        • CombinationApprovals::verifyAllCombinations(Reporter, ...)
      • Removed 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
      • The following macros have been changed.

    | Old (removed) | 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 |

    • New features
      • None
    • Bug fixes
      • None
    • Other changes
      • None
    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.10.0.0.hpp(125.19 KB)
  • v.9.0.0(Jun 3, 2020)

    DON'T PANIC!

    We expect most of our users to have no problem with this upgrade. Changes are only needed when:

    1. you are passing in a specific reporter, which is usually an infrequent and temporary coding state,
    2. you call verifyWithExtension(object, ".json") is now
      Approvals::verify(object, Options().fileOptions().withFileExtension(".json"))

    Deprecating verify(..., Reporter)

    This is the third of a series of rapid releases, to make small steps in deprecating passing in a Reporter object, in favor of an Options object, to the verify*() methods. See Why We Are Converting To Options for easy ways to update your code.

    1. deprecation warnings are off: users can opt-in (v.8.7.0)
    2. deprecation warnings are on: users can opt-out (v.8.9.1)
    3. deprecation warnings are forced, code still exists (v.8.9.2)
    4. the deprecated methods are hidden: users can opt-in (v.9.0.0) <== you are here
    5. the deprecated methods are removed
    • Breaking changes
      • Hidden methods:
        • Approvals::verify(..., Reporter)
        • Approvals::verifyAll(..., Reporter)
        • Approvals::verifyExistingFile(..., Reporter)
        • Approvals::verifyExceptionMessage(..., Reporter)
        • Approvals::verifyWithExtension(...)
        • CombinationApprovals::verifyAllCombinations(Reporter, ...)
      • Hidden 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
      • The following macros have been changed.

    | Old (hidden) | 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 |

    • New features
      • None
    • Bug fixes
      • None
    • Other changes
      • APPROVAL_TESTS_HIDE_DEPRECATED_CODE is now enabled by default.
    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.9.0.0.hpp(133.99 KB)
  • v.8.9.2(Jun 3, 2020)

    DON'T PANIC!

    We expect most of our users to have no problem with this upgrade. Source code is totally backwards-compatible, as long as you don't treat compiler warnings as errors. Even if you do, it only applies when:

    1. you are passing in a specific reporter, which is usually an infrequent and temporary coding state,
    2. you call verifyWithExtension().

    Deprecating verify(..., Reporter)

    This is the second of a series of rapid releases, to make small steps in deprecating passing in a Reporter object, in favor of an Options object, to the verify*() methods. See Why We Are Converting To Options for easy ways to update your code.

    1. deprecation warnings are off: users can opt-in (v.8.7.0)
    2. deprecation warnings are on: users can opt-out (v.8.9.1)
    3. deprecation warnings are forced, code still exists (v.8.9.2) <== you are here
    4. the deprecated methods are hidden: users can opt-in
    5. the deprecated methods are removed
    • Breaking changes
      • None
    • New features
      • None
    • Bug fixes
      • None
    • Other changes
      • APPROVAL_TESTS_SHOW_DEPRECATION_WARNINGS is now ignored. Warnings are always shown when using the verify*() methods that took a Reporter.
    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.8.9.2.hpp(133.99 KB)
  • v.8.9.1(Jun 3, 2020)

    DON'T PANIC!

    We expect most of our users to have no problem with this upgrade. Source code is totally backwards-compatible, as long as you don't treat compiler warnings as errors. Even if you do, it only applies when:

    1. you are passing in a specific reporter, which is usually an infrequent and temporary coding state,
    2. you call verifyWithExtension().

    Deprecating verify(..., Reporter)

    This is the first of a series of rapid releases, to make small steps in deprecating passing in a Reporter object, in favor of an Options object, to the verify*() methods. See Why We Are Converting To Options for easy ways to update your code.

    1. deprecation warnings are off: users can opt-in (v.8.7.0)
    2. deprecation warnings are on: users can opt-out (v.8.9.1) <== you are here
    3. deprecation warnings are forced, code still exists
    4. the deprecated methods are hidden: users can opt-in
    5. the deprecated methods are removed
    • Breaking changes
      • None
    • New features
      • None
    • Bug fixes
      • None
    • Other changes
      • APPROVAL_TESTS_SHOW_DEPRECATION_WARNINGS is now enabled by default.
    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.8.9.1.hpp(134.24 KB)
  • v.8.9.0(Jun 1, 2020)

  • v.8.8.1(May 28, 2020)

  • v.8.8.0(May 18, 2020)

  • v.8.7.1(May 18, 2020)

  • v.8.7.0(May 15, 2020)

    See the v.8.7.0 milestone for the full list of changes.

    • Breaking changes
      • Planned deprecation: The overloads of verify(), verifyAll() and verifyAllCombinations() which take a Reporter have been deprecated.
      • If you happen to have specialised StringUtils::toString(), you would now need to specialize StringMaker::toString() instead.
        • Note: this was previously unsupported behavior, so we are not bumping the major version number.
        • Here is how to update your code:
    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() and verifyAllCombinations() calls:
      • New mechanics for String conversions (thank you @alepez)
        • The class Approvals is now an alias for TApprovals< ToStringCompileTimeOptions< StringMaker > >
        • CombinationApprovals is now an alias for the class TCombinationApprovals< 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)
      • Our Conan.io package now supports our Boost.Test integration (#121)
    • Bug fixes
      • None
    • Other changes

    | 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 |

    Source code(tar.gz)
    Source code(zip)
    ApprovalTests.v.8.7.0.hpp(129.74 KB)
A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD - using C++11, C++14, C++17 and later (or C++03 on the Catch1.x branch)

Catch2 v3 is being developed! You are on the devel branch, where the next major version, v3, of Catch2 is being developed. As it is a significant rewo

Catch Org 16k Jan 9, 2023
A modern, C++11-native, single-file header-only, tiny framework for unit-tests, TDD and BDD (includes C++98 variant)

lest – lest errors escape testing This tiny C++11 test framework is based on ideas and examples by Kevlin Henney [1,2] and on ideas found in the CATCH

Martin Moene 355 Dec 28, 2022
testing joystick under Linux environment, support monitoring disconnection state and auto recovery mode

qjoystick This qjoystick class is rewritten based on the library: https://github.com/drewnoakes/joystick. Please look at this library if you want to s

ibov 1 Oct 30, 2021
A dynamic mock tool for C/C++ unit test on Linux&MacOS X86_64

lmock 接口 替换一个函数,修改机器指令,用新函数替换旧函数,支持全局函数(包括第三方和系统函数)、成员函数(包括静态和虚函数)

null 55 Dec 21, 2022
TestFrame - This is a test framework that uses Raylib and ImGui together to help test and develop concepts

This is a test framework that uses Raylib and ImGui together to help test and develop concepts. It is made using C++ because it uses classes for windows and views.

Jeffery Myers 22 Dec 29, 2022
C++ Testing using spies and fakes for isolation and simulation

ELFspy is a library for linux for writing tests using fakes and spies in C++. For very large call graphs, the testing of the higher nodes can be diffi

Robin Nicholson 49 Dec 9, 2022
Googletest - Google Testing and Mocking Framework

GoogleTest OSS Builds Status Announcements Release 1.10.x Release 1.10.x is now available. Coming Soon Post 1.10.x googletest will follow Abseil Live

Google 28.8k Jan 9, 2023
Practical mutation testing tool for C and C++

Mull Mull is a tool for Mutation Testing based on LLVM/Clang with a strong focus on C and C++ languages. For installation and usage please refer to th

Mull Project 652 Dec 30, 2022
An area to test reading in ATLAS xAOD format and writing out to Parquet

xaod_to_parquet An area to test reading in ATLAS xAOD format and writing out to Parquet Getting the Code Clone the repository with the --recursive fla

Daniel Antrim 2 Nov 19, 2021
Xerus - A general purpose library for numerical calculations with higher order tensors, Tensor-Train Decompositions / Matrix Product States and other Tensor Networks

About The xerus library is a general purpose library for numerical calculations with higher order tensors, Tensor-Train Decompositions / Matrix Produc

null 18 Apr 20, 2021
A simple, cross-platform, and continuously integrated C++14 project template

Project Name A simple, cross-platform, and continuously integrated C++14 project template. Making cross platform C++ projects is widely known to be a

Arnav Borborah 63 Dec 5, 2022
The Hoard Memory Allocator: A Fast, Scalable, and Memory-efficient Malloc for Linux, Windows, and Mac.

The Hoard Memory Allocator Copyright (C) 1998-2020 by Emery Berger The Hoard memory allocator is a fast, scalable, and memory-efficient memory allocat

Emery Berger 927 Jan 2, 2023
Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems

Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. Audacity is open source software licensed under GPL, version 2 or later.

Audacity 8.7k Dec 31, 2022
Sneedacity (formerly Audacity) is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems.

Sneedacity (formerly Audacity) is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. Sneedacity is open source software licensed under GPL, version 2 or later.

Sneed's Feed & Seed 874 Dec 30, 2022
Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on OpenGL 1.x-4.x supporting Windows, Linux and Mac OS X.

Visualization Library 2.2 Gallery About Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on the in

Michele 313 Nov 8, 2022
Oxygine is C++ engine and framework for 2D games on iOS, Android, Windows, Linux and Mac

BUILD AND RUN See oxygine-framework/readme/ folder. It has instructions on how to build and run oxygine on different platforms. Wiki available at http

Oxygine 735 Dec 23, 2022
GB Studio is a quick and easy to use retro adventure game creator for Game Boy available for Mac, Linux and Windows

GB Studio is a quick and easy to use retro adventure game creator for Game Boy available for Mac, Linux and Windows

Chris Maltby 6.8k Jan 8, 2023
Alpha Plot is a free application for Scientific Data Analysis and Visualization for Windows, Linux and Mac OS X

Alpha Plot is a free application for Scientific Data Analysis and Visualization for Windows, Linux and Mac OS X (probably BSD also). Web Link Website

Arun Narayanankutty 171 Dec 26, 2022
Slate is a bitmap editor available for Linux, Windows and Mac.

Slate is a bitmap editor available for Linux, Windows and Mac.

Mitch Curtis 943 Dec 30, 2022
Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactively receive/edit/monitor data and send commands to an embedded system via the serial bus

See wiki for full documentation Serial Data Monitor Description Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactivel

monnoliv 4 Oct 29, 2021