Skip to content
This repository has been archived by the owner on May 24, 2018. It is now read-only.
/ mavis Public archive

Lightweight, header only C++14 unit test framework inspired by jasmine.

Notifications You must be signed in to change notification settings

atomicptr/mavis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 

Repository files navigation

mavis

Lightweight, header only C++14 unit test framework inspired by jasmine.

100% Macro free!

Usage

Just put the mavis.hpp somewhere into your project and use it like this:

#include "path/to/mavis.hpp"

// whereever you want to write your tests

mavis::describe("A suite", [](auto &suite) {
    int a = 0;

    suite.it("contains spec with an expectation", [&a](auto &spec) {
        spec.expect_equals(a, 0);
    });

    suite.it("contains specs with multiple expectations", [&a](auto &spec) {
        spec.expect_equals(a + 2, 2);
        spec.expect_equals(a * 2, 0);
    });
});

Please note that expect_equals also works with custom types if you override:

  • operator==(...)
  • operator<<(std::ostream&, custom_type&)

For more informations please read the documentation

License

MIT

About

Lightweight, header only C++14 unit test framework inspired by jasmine.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages