| 1 |
# About Check |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
Check is a unit testing framework for C. It features a simple interface |
| 6 |
for defining unit tests, putting little in the way of the |
| 7 |
developer. Tests are run in a separate address space, so Check can |
| 8 |
catch both assertion failures and code errors that cause segmentation |
| 9 |
faults or other signals. The output from unit tests can be used within |
| 10 |
source code editors and IDEs. |
| 11 |
|
| 12 |
See https://libcheck.github.io/check for more information, including a |
| 13 |
tutorial. The tutorial is also available as `info check`. |
| 14 |
|
| 15 |
# Installation |
| 16 |
|
| 17 |
Check has the following dependencies: |
| 18 |
|
| 19 |
* [automake](https://www.gnu.org/software/automake/)-1.9.6 (1.11.3 on OS X if you are using /usr/bin/ar) |
| 20 |
* [autoconf](https://www.gnu.org/software/autoconf/)-2.59 |
| 21 |
* [libtool](https://www.gnu.org/software/libtool/)-1.5.22 |
| 22 |
* [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)-0.20 |
| 23 |
* [texinfo](https://www.gnu.org/software/texinfo/)-4.7 (for documentation) |
| 24 |
* tetex-bin (or any texinfo-compatible TeX installation, for documentation) |
| 25 |
* POSIX [sed](https://en.wikipedia.org/wiki/Sed) |
| 26 |
|
| 27 |
The versions specified may be higher than those actually needed. |
| 28 |
|
| 29 |
## autoconf |
| 30 |
|
| 31 |
$ autoreconf --install |
| 32 |
$ ./configure |
| 33 |
$ make |
| 34 |
$ make check |
| 35 |
$ make install |
| 36 |
$ sudo ldconfig |
| 37 |
|
| 38 |
in this directory to set everything up. autoreconf calls all of the |
| 39 |
necessary tools for you, like autoconf, automake, autoheader, etc. If |
| 40 |
you ever change something during development, run autoreconf again |
| 41 |
(without --install), and it will perform the minimum set of actions |
| 42 |
necessary. Check is installed to `/usr/local/lib` by default. ldconfig rebuilds |
| 43 |
the linker cache so that newly installed library file is included in the cache. |
| 44 |
|
| 45 |
## cmake |
| 46 |
|
| 47 |
$ mkdir build |
| 48 |
$ cd build |
| 49 |
$ cmake ../ |
| 50 |
$ make |
| 51 |
$ CTEST_OUTPUT_ON_FAILURE=1 make test |
| 52 |
|
| 53 |
# Linking against Check |
| 54 |
|
| 55 |
Check uses variadic macros in check.h, and the strict C90 options for |
| 56 |
gcc will complain about this. In gcc 4.0 and above you can turn this |
| 57 |
off explicitly with `-Wno-variadic-macros`. In a future API it would be |
| 58 |
nice to eliminate these macros. |
| 59 |
|
| 60 |
# Packaging |
| 61 |
|
| 62 |
Check is available packaged for the following operating systems: |
| 63 |
|
| 64 |
[](https://repology.org/project/check/versions) |
| 65 |
|