approvals/ApprovalTests.cpp

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

C++

339

4,321 commits

updated Aug 27, 2026

See the code

README

Approval Tests for C++

build cygwin mingw python-tests

ConanCenter package vcpkg
Documentation Status
License Contributor Covenant

:arrow_down: Download the latest version (v.10.13.0) of the single header file here.

:book: 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.

approval-test
approval-testing
c-plus-plus
cpp11
golden-master
header-only
regression-testing
single-file
snapshot-testing
testing

Contributors

claremacrae

3,770 commits

isidore

322 commits

Laguna1989

93 commits

actions-user

43 commits

approvals/ApprovalTests.cpp

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

C++

339

4,321 commits

updated Aug 27, 2026

See the code

README

Approval Tests for C++

build cygwin mingw python-tests

ConanCenter package vcpkg
Documentation Status
License Contributor Covenant

:arrow_down: Download the latest version (v.10.13.0) of the single header file here.

:book: 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.

approval-test
approval-testing
c-plus-plus
cpp11
golden-master
header-only
regression-testing
single-file
snapshot-testing
testing

Contributors

claremacrae

3,770 commits

isidore

322 commits

Laguna1989

93 commits

actions-user

43 commits

Languages

C++

70.2%

Python

18.7%

CMake

8.9%

Shell

1.3%