|
Packit |
0b5880 |
# About Check
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
[![Travis Build Status](https://travis-ci.org/libcheck/check.svg?branch=master)](https://travis-ci.org/libcheck/check)
|
|
Packit |
0b5880 |
[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/github/libcheck/check?svg=true)](https://ci.appveyor.com/project/libcheck/check/branch/master)
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
Check is a unit testing framework for C. It features a simple interface
|
|
Packit |
0b5880 |
for defining unit tests, putting little in the way of the
|
|
Packit |
0b5880 |
developer. Tests are run in a separate address space, so Check can
|
|
Packit |
0b5880 |
catch both assertion failures and code errors that cause segmentation
|
|
Packit |
0b5880 |
faults or other signals. The output from unit tests can be used within
|
|
Packit |
0b5880 |
source code editors and IDEs.
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
See https://libcheck.github.io/check for more information, including a
|
|
Packit |
0b5880 |
tutorial. The tutorial is also available as `info check`.
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
# Installation
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
Check has the following dependencies:
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
* [automake](https://www.gnu.org/software/automake/)-1.9.6 (1.11.3 on OS X if you are using /usr/bin/ar)
|
|
Packit |
0b5880 |
* [autoconf](https://www.gnu.org/software/autoconf/)-2.59
|
|
Packit |
0b5880 |
* [libtool](https://www.gnu.org/software/libtool/)-1.5.22
|
|
Packit |
0b5880 |
* [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)-0.20
|
|
Packit |
0b5880 |
* [texinfo](https://www.gnu.org/software/texinfo/)-4.7 (for documentation)
|
|
Packit |
0b5880 |
* tetex-bin (or any texinfo-compatible TeX installation, for documentation)
|
|
Packit |
0b5880 |
* POSIX [sed](https://en.wikipedia.org/wiki/Sed)
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
The versions specified may be higher than those actually needed.
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
## autoconf
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
$ autoreconf --install
|
|
Packit |
0b5880 |
$ ./configure
|
|
Packit |
0b5880 |
$ make
|
|
Packit |
0b5880 |
$ make check
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
in this directory to set everything up. autoreconf calls all of the
|
|
Packit |
0b5880 |
necessary tools for you, like autoconf, automake, autoheader, etc. If
|
|
Packit |
0b5880 |
you ever change something during development, run autoreconf again
|
|
Packit |
0b5880 |
(without --install), and it will perform the minimum set of actions
|
|
Packit |
0b5880 |
necessary.
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
## cmake
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
$ mkdir build
|
|
Packit |
0b5880 |
$ cd build
|
|
Packit |
0b5880 |
$ cmake ../
|
|
Packit |
0b5880 |
$ make
|
|
Packit |
0b5880 |
$ CTEST_OUTPUT_ON_FAILURE=1 make test
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
# Linking against Check
|
|
Packit |
0b5880 |
|
|
Packit |
0b5880 |
Check uses variadic macros in check.h, and the strict C90 options for
|
|
Packit |
0b5880 |
gcc will complain about this. In gcc 4.0 and above you can turn this
|
|
Packit |
0b5880 |
off explicitly with `-Wno-variadic-macros`. In a future API it would be
|
|
Packit |
0b5880 |
nice to eliminate these macros.
|