Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
[DEPRECATED] A C++11 unit testing framework
branch: master

Add clang specific diagnostic disabling for the comparison type traits.

This solves the issue mentioned in the comments of issue #13.
Failed to load latest commit information.
configure
docs
include/unittest Add clang specific diagnostic disabling for the comparison type traits.
package
tests Fix #13 (Also solves an issue where one couldn't compare std::string …
.gitattributes
.gitignore Initial Commit
CMakeLists.txt Update to version 1.0.4
License.rst Initial Commit
Readme.rst

Readme.rst

Overview

MNMLSTC Unittest is a C++11 unit testing framework. It focuses on being small, minimal, expressive, and easy to use. Unlike most C++ unit testing frameworks which rely on preprocessor macros, unittest tries to take a page from the python unittest module, and as such it has no preprocessor macros.

Information on installing and using unittest (as well as modifying its internals) can be found in its documentation.

MNMLSTC Unittest is released under the Apache 2.0 license.

Basic Example

Below is a basic example of how unittest can be used:

#include <unittest/unittest.hpp>

int main () {
  using namespace unittest;

  test("my-test") = {
    task("assert-equal") = [] {
      assert::not_equal(1, 2);
      assert::in(1, { 1, 2, 3, 4 });
      assert::throws<my_exception_type>([] { throw my_exception_type; });
    },
    task("fails") = [] { assert::fail(); },
    task("skip") = skip("always-skip") = [] { assert::fail(); }
  };

  monitor::run();
}

Requirements

There are several requirements to fully use unittest:

Sphinx and the Cloud Sphinx Theme are only necessary if generating the documentation manually, and this is not provided by the build script at this time.

Something went wrong with that request. Please try again.