A KISS, non-intrusive cross-platform C unit testing framework
Steffen Vogel 5b0f2b1290 create nanomsg sockets in /var/lib by default 2 years ago
.cmake travis: Use the default python installation for cram 2 years ago
.githooks hooks: Append diffs with tee rather than overwrite them 2 years ago
dependencies boxfort,windows: Fixed arena mapping errors. Fixes #149. 2 years ago
dev contrib: Added autotools skeleton 2 years ago
doc doc: Fixed wrong usage of parameterized test arrays 2 years ago
include/criterion debug: Added support for --debug=idle. Fixes #154. 2 years ago
po debug: Added support for --debug=idle. Fixes #154. 2 years ago
samples asserts: Add assertions for wide strings 2 years ago
src create nanomsg sockets in /var/lib by default 2 years ago
test cram,osx: Fixed mismatch in getopt diagnostic 2 years ago
.bumpversion.cfg release: Prepare a release candidate for 2.3.0 2 years ago
.gitignore Merge branch 'features/io-rewrite-nanopb' into bleeding 3 years ago
.gitmodules boxfort: Added boxfort dependency 2 years ago
.travis.yml travis: Use the default python installation for cram 2 years ago
.uncrustify.cfg style: Fixed (A) Op (B) formatting taking 'Op' as a function rather than an operator 2 years ago
AUTHORS authors: Added AUTHORS file 2 years ago
CMakeLists.txt dyncall: Fixed -fPIC warnings on windows and CXX requirement 2 years ago
CONTRIBUTING.md contributing: Added bit on commit messages 2 years ago
ChangeLog changelog: Added the parameter change to the custom logger provider API 2 years ago
LICENSE We're in 2016. 3 years ago
README.md contrib: Added autotools skeleton 2 years ago
appveyor.yml release: Prepare a release candidate for 2.3.0 2 years ago
debian.copyright [license] Updated license year on missed files 3 years ago
description.txt Added missing files for ppa builds 3 years ago

README.md

Criterion Logo

Unix Build Status Windows Build Status Coverage Status License Version

A dead-simple, yet extensible, C and C++ unit testing framework.

Screencast

Philosophy

Most test frameworks for C require a lot of boilerplate code to set up tests and test suites -- you need to create a main, then register new test suites, then register the tests within these suits, and finally call the right functions.

This gives the user great control, at the unfortunate cost of simplicity.

Criterion follows the KISS principle, while keeping the control the user would have with other frameworks:

  • C99 and C++11 compatible.
  • Tests are automatically registered when declared.
  • Implements a xUnit framework structure.
  • A default entry point is provided, no need to declare a main unless you want to do special handling.
  • Test are isolated in their own process, crashes and signals can be reported and tested.
  • Unified interface between C and C++: include the criterion header and it just works.
  • Supports parameterized tests and theories.
  • Progress and statistics can be followed in real time with report hooks.
  • TAP output format can be enabled with an option.
  • Runs on Linux, FreeBSD, Mac OS X, and Windows (Compiling with MinGW GCC and Visual Studio 2015+).

Downloads

Packages

  • Mac OS X: brew install snaipe/soft/criterion
  • AUR: yaourt -S criterion

Binary archives

Binary releases are available on the release page

If you have a different platform, you can still build the library from source

Developer Resources

Documentation

An online documentation is available on ReadTheDocs (PDF | Zip | Epub)

Samples

Sample tests can be found in the sample directory.

Getting help

Channel Description
Subscribe to the mailing list Criterion mailing list on freelists.org
Snaipe/Criterion on gitter.im
#criterion on irc.freenode.net

Misc

Credits

Logo made by Paul Bouigue