๐Ÿงช Testing C++ with GoogleTest
Home Chapters Examples Diagrams Bibliography GitHub โ†—
Home / Beyond the basics
Part 2 3 chapters

Beyond the basics

Parameterized and typed tests, death tests, and testing modern C++20/23 features.

Chapter 6

Parameterized and typed tests

Run one test body over many inputs with TEST_P, and over many types with TYPED_TEST, instead of copying a case and changing one value.

30 minRead โ†’
Chapter 7

Death tests, exceptions, and std::expected

Test the failure paths: a recoverable error returned as a std::expected, a contract violation thrown as an exception, and a programming bug that aborts, checked with EXPECT_DEATH.

30 minRead โ†’
Chapter 8

Testing modern C++20 and C++23

Test the features that define modern C++: a concept checked at compile time, a lazy ranges pipeline materialized to a value, and a generator coroutine whose yields you collect, including an infinite one made safe by laziness.

30 minRead โ†’
โ† Previous part Foundations Next part โ†’ Mocking

Testing C++ with GoogleTest

A chaptered, runnable guide to testing modern C++ (C++20/23) with GoogleTest and GoogleMock on Fedora 44, from your first test to concurrency, sanitizers, and CI.

Tutorial

  • Chapters
  • Examples
  • Bibliography

Reference

  • GoogleTest docs โ†—
  • CMake docs โ†—
  • View on GitHub โ†—
  • Issues โ†—
Open source ยท Apache-2.0 (code) / CC BY 4.0 (prose) Last built 2026-11-11