codylico / munit-plus

Unofficial port of the µnit unit testing library to C++ 2011

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

µnit-plus

This is an unofficial port of the µnit unit testing library to C++ 2011. Features include:

  • API similar to the original library
  • Proper handling of exceptions
  • Templated functions for randomizing trivial instances
  • Support for user-defined comparison operators for assertions
  • Support for custom formatters for user-defined classes

The license remains MIT.

Build status for µnit-plus

Build status Windows build status

Original README continues below.

µnit (from original)

µ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.

About

Unofficial port of the µnit unit testing library to C++ 2011

License:Other


Languages

Language:C++ 98.3%Language:Makefile 0.9%Language:Meson 0.8%Language:Emacs Lisp 0.0%