= Unit Testing

:toc:
:toc-placement!:

toc::[]

[[intro]]
Introduction
------------

Unit testing is a software development process in which the smallest testable parts of an
application, called units, are individually and independently scrutinized
for proper operation. This can involve taking a class, function, or algorithm
and writing test cases that can be run to verify that the unit is working correctly.

CMake includes a tool called link:https://cmake.org/Wiki/CMake/Testing_With_CTest[CTest]
which allows you to enable the `make test` target to run automated tests such as unit tests.

There are many unit-testing frameworks available which can be used to help automate
and ease the development of unit tests. In these examples I show how to use
some of these frameworks and call them using the CMake testing utility CTest.

The examples here include using the following frameworks:

* http://www.boost.org/doc/libs/1_56_0/libs/test/doc/html/utf/user-guide.html[Boost Unit Test Framework]
* https://github.com/google/googletest[Google Test - Download]
* https://github.com/catchorg/Catch2[Catch2]
