A KISS, non-intrusive cross-platform C unit testing framework
Go to file
Snaipe bddeda4acd [v2.2.2] Merge branch 'patch' (Patch release)
* Fix: fixed deadlocks when tests are terminated too fast
* Fix: fixed crash during test teardown if spawning new threads in the test
* Fix: fixed memory leak in disabled tests
2016-06-20 09:39:36 +02:00
.cmake Switched CMAKE_*_DIR variables to PROJECT_*_DIR 2016-03-05 13:34:26 +01:00
dependencies [Issue #76] Updated dyncall to latest for icc fix 2015-11-27 00:13:59 +01:00
dev Added find module for criterion 2015-09-09 17:14:45 +02:00
doc release: Prepare release 2.2.2 2016-06-20 09:36:25 +02:00
include/criterion Fixed redirected standard streams being leaked by cr_(assert|expect)_std(out|err) 2016-03-05 15:51:50 +01:00
po Print strerror when failing to open a report file 2015-11-27 12:24:42 +01:00
samples Fixed theories regression tests 2015-12-08 01:56:01 +01:00
src pthread: Fixed child pump not being joined right after a fork. 2016-06-20 09:26:13 +02:00
test Fixed redirected standard streams being leaked by cr_(assert|expect)_std(out|err) 2016-03-05 15:51:50 +01:00
.bumpversion.cfg release: Prepare release 2.2.2 2016-06-20 09:36:25 +02:00
.gitignore Added deb generation rules in cmake module 2015-11-28 14:26:08 +01:00
.gitmodules Added klib dependency 2015-11-10 22:04:25 +01:00
.travis.yml Revert "Added install checks on travis builds" 2015-11-27 12:26:49 +01:00
CMakeLists.txt release: Prepare release 2.2.2 2016-06-20 09:36:25 +02:00
CONTRIBUTING.md Updated contribution road map 2015-09-17 00:29:11 +02:00
ChangeLog release: Prepare release 2.2.2 2016-06-20 09:36:25 +02:00
LICENSE Initial commit 2015-01-31 13:45:12 +01:00
README.md release: Prepare release 2.2.2 2016-06-20 09:36:25 +02:00
appveyor.yml release: Prepare release 2.2.2 2016-06-20 09:36:25 +02:00
debian.copyright Added missing files for ppa builds 2015-11-28 14:33:09 +01:00
description.txt Added missing files for ppa builds 2015-11-28 14:33:09 +01:00

README.md

Criterion Logo =========

Unix Build Status Windows Build Status Coverage Status License Version

Analytics

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

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

Gitter.im chat room: Join the chat at https://gitter.im/Snaipe/Criterion
IRC channel: #criterion on irc.freenode.net

Misc

Credits

Logo done by Greehm