Criterion 0,1 travis-ci

A KISS, non-intrusive cross-platform C unit testing framework

Criterion Logo

Unix Build Status Windows Build Status Coverage Status License Version

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



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:

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



  • 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


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


Sample tests can be found in the sample directory.

Getting help

Channel Description
Subscribe to the mailing list Criterion mailing list on
Join the chat at Snaipe/Criterion on
Join #criterion on freenode #criterion on



Logo made by Paul Bouigue

Related Repositories



A KISS, non-intrusive cross-platform C unit testing framework ...



A powerful but simple library for measuring the performance of Haskell code. ...

Statistics-driven micro-benchmarking library ...



Discretization with Fayyad and Irani's minimum description length principle criterion (MDLPC) ...



A loss function based on the distances between anchor, positive and negative embeddings used in FaceNet ...

Top Contributors

Snaipe a1lu am11 kevinoid MrAnno offa blinskey hppritcha


-   v2.2.2 zip tar
-   v2.2.1 zip tar
-   v2.2.0 zip tar
-   v2.1.1 zip tar
-   v2.1.0 zip tar
-   v2.0.2 zip tar
-   v2.0.1 zip tar
-   v2.0.0 zip tar
-   v1.3.1 zip tar
-   v1.3.0 zip tar
-   v1.2.2 zip tar
-   v1.2.1 zip tar
-   v1.2.0 zip tar
-   v1.1.0 zip tar
-   v1.0.0 zip tar
-   v0.3 zip tar
-   v0.2 zip tar
-   v0.1 zip tar
-   2.3.0-rc1 zip tar