https://github.com/approvals/ApprovalTests.cpp
Native ApprovalTests for C++ on Linux, Mac and Windows
https://github.com/approvals/ApprovalTests.cpp
approval-test approval-testing c-plus-plus cpp11 golden-master header-only regression-testing single-file snapshot-testing testing
Last synced: 2 months ago
JSON representation
Native ApprovalTests for C++ on Linux, Mac and Windows
- Host: GitHub
- URL: https://github.com/approvals/ApprovalTests.cpp
- Owner: approvals
- License: apache-2.0
- Created: 2013-04-08T01:53:54.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2025-04-22T17:37:37.000Z (3 months ago)
- Last Synced: 2025-04-22T17:41:51.036Z (3 months ago)
- Topics: approval-test, approval-testing, c-plus-plus, cpp11, golden-master, header-only, regression-testing, single-file, snapshot-testing, testing
- Language: C++
- Homepage: https://approvaltestscpp.readthedocs.io/en/latest/
- Size: 11.8 MB
- Stars: 324
- Watchers: 17
- Forks: 53
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- awesome-cpp-testing - Approval Tests for C++ - Native ApprovalTests for C++ on Linux, Mac and Windows. (Testing Frameworks)
README
#
Approval Tests for C++
[](https://github.com/approvals/ApprovalTests.cpp/actions/workflows/github_actions_build.yml)
[](https://github.com/approvals/ApprovalTests.cpp/actions/workflows/cygwin.yml)
[](https://github.com/approvals/ApprovalTests.cpp/actions/workflows/mingw.yml)
[](https://github.com/approvals/ApprovalTests.cpp/actions/workflows/python-tests.yml)[](https://conan.io/center/approvaltests.cpp)
[](https://vcpkg.io/en/packages.html?query=approval-tests-cpp)
[](https://approvaltestscpp.readthedocs.io/en/latest/?badge=latest)
[](https://opensource.org/licenses/Apache-2.0)
[](/CODE_OF_CONDUCT.md#top):arrow_down:
Download the latest version (v.10.13.0) of the **single header file** here.:book: [**Read the Docs**](https://approvaltestscpp.readthedocs.io/en/latest/)
## Contents
* [What are Approval Tests?](#what-are-approval-tests)
* [Requirements](#requirements)
* [Getting Started](#getting-started)
* [ToString (ostream insertion)](#tostring-ostream-insertion)
* [What's new?](#whats-new)
* [Feedback](#feedback)## 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](/doc/Overview.md#top) and a [tutorial](/doc/Tutorial.md#top).
They are great for testing objects with lots of fields, or lists of objects.
## Requirements
* C++11 (or above) compiler
* Mac/Linux/Windows
* One of: [GoogleTest](https://github.com/google/googletest), [Catch2](https://github.com/catchorg/Catch2), [CppUTest](http://cpputest.github.io/), [doctest](https://github.com/onqtam/doctest), [Boost.Test](https://www.boost.org/doc/libs/1_72_0/libs/test/doc/html/index.html), [\[Boost\].UT](https://github.com/boost-experimental/ut)## Getting Started
* Download [The Approval.cpp Starter Project](https://github.com/approvals/ApprovalTests.Cpp.StarterProject)
* Read the [Getting Started](/doc/GettingStarted.md#top) page
* [Set up your main file.](/doc/GettingStarted.md#main-file)
* Read the [**User Guide on Read the Docs**](https://approvaltestscpp.readthedocs.io/en/latest/) or
[**on GitHub**](/doc/README.md#top).
* Watch the [Videos](/doc/Videos.md#top)## 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](/doc/ToString.md#top)## What's new?
Check out the [Features](/doc/Features.md#top) page or [upcoming release notes](https://github.com/approvals/ApprovalTests.cpp/blob/master/build/relnotes_x.y.z.md) to see what we've been working on lately, or browse the [past release notes](https://github.com/approvals/ApprovalTests.cpp/releases).
## Feedback
If you have any comment or suggestion on this documentation, please email Llewellyn or Clare via the details in the [Contributing page](/doc/Contributing.md#top).