0Pricing
C++ Academy · Lesson

Setting Up GTest

Add and run the framework.

Why a Test Framework?

Google Test (GTest) is a widely used C++ unit-testing framework. It provides test registration, rich assertions, fixtures, and clear reporting so you can verify code automatically.

Getting GTest

Common ways to obtain GTest:

  • System package (e.g. libgtest-dev)
  • FetchContent in CMake pulling from GitHub
  • A vendored submodule

FetchContent is the most portable for new projects.

All lessons in this course

  1. Setting Up GTest
  2. Assertions and Matchers
  3. Fixtures and Setup
  4. Mocking with GMock
← Back to C++ Academy