µnit is a small testing framework for C https://nemequ.github.io/munit/
Find a file
Tatsuhiro Tsujikawa 11e8e3466b
Merge pull request #1 from pemensik/example-main-array
Remove undefined and unneeded macro
2025-08-17 15:18:36 +09:00
.appveyor.yml Add support for Visual Studio 2008 (9.0) and up. 2017-03-09 15:58:20 -08:00
.clang-format Change clang-format options 2024-08-28 17:29:41 +09:00
.dir-locals.el Get rid of tabs, add a .dir-locals.el to avoid them in the future. 2016-02-02 00:55:19 -08:00
.gitignore Update .gitignore 2024-02-02 18:17:38 +09:00
.travis.yml travis: create meson configuration 2018-03-10 20:03:57 -08:00
COPYING Add COPYING file. 2016-01-22 13:18:12 -08:00
example.c Remove undefined and unneeded macro 2024-11-05 12:34:42 +01:00
Makefile Add OpenMP support for PRNG. 2017-02-16 22:43:55 -08:00
meson.build Add meson.build 2018-03-10 19:26:45 -08:00
munit.c Remove ATOMIC_UINT32_INIT 2025-01-03 12:53:50 +09:00
munit.h Add missing parentheses to macro arguments 2025-05-11 21:30:17 +09:00
munitxx.h Add missing parentheses to macro arguments 2025-05-11 21:30:17 +09:00
README.md README: change size of header 2018-03-11 12:46:46 -07:00

µnit

µnit is a small but full-featured unit testing framework for C. It has no dependencies (beyond libc), is permissively licensed (MIT), and is easy to include into any project.

For more information, see the µnit web site.

Build status Windows build status

Features

Features µnit currently includes include:

  • Handy assertion macros which make for nice error messages.
  • Reproducible cross-platform random number generation, including support for supplying a seed via CLI.
  • Timing of both wall-clock and CPU time.
  • Parameterized tests.
  • Nested test suites.
  • Flexible CLI.
  • Forking (except on Windows).
  • Hiding output of successful tests.

Features µnit does not currently include, but some day may include (a.k.a., if you file a PR…), include:

Include into your project with meson

In your subprojects folder put a munit.wrap file containing:

[wrap-git]
directory=munit
url=https://github.com/nemequ/munit/
revision=head

Then you can use a subproject fallback when you include munit as a dependency to your project: dependency('munit', fallback: ['munit', 'munit_dep'])

Documentation

See the µnit web site.

Additionally, there is a heavily-commented example.c in the repository.