Check (unit testing framework)
Stable release | 0.10.0 / August 2, 2015 |
---|---|
Written in | C |
Operating system | Cross-platform |
Type | Unit testing framework |
License | LGPL |
Website |
libcheck |
Check is an open source unit testing framework in the style of xUnit for C programs. The framework is considered stable—even though it has not reached its 1.0 release yet—and is available in the package distribution systems of most Linux distributions, as well as for Windows and OS X.
Check is used by some well-known projects such as GStreamer.
Example of Check unit test
Test writing using Check is very simple. The file in which the checks are defined must include check.h
as so:
#include <check.h>
// The basic unit test looks as follows:
START_TEST (test_name)
{
/* unit test code */
}
END_TEST
// The START_TEST/END_TEST pair are macros that setup basic structures to permit testing.
// It is a mistake to leave off the END_TEST marker; doing so produces all sorts of strange errors when the check is compiled.
External links
This article is issued from Wikipedia - version of the Tuesday, January 19, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.