cmake-examples/05-unit-testing
2015-12-01 23:05:48 +00:00
..
boost add unit-testing to my tests. All support for pre and post tests 2015-12-01 23:05:48 +00:00
README.adoc add unit testing folder 2015-12-01 22:51:53 +00:00

= 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]