Skip to content

imdanielsp/mTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Minimal Testing Framework

This is a header-only lightweight test framework that can be used by just including mtest.hpp into your source code.

Note: this requires C++17. What does this mean? When compiling your project, add --std=c++17 to your compiler invocation command. If C++17 is available, you should be all set.

How to use:

#include "mtest.hpp"

int main()
{
  MTEnv mtEnv;

  mtEnv.add_test({
    test_f("Test Name", "Message if fails", {
      env.expect_eq<int>(3, 3);
      env.expect_true(9 == 9);
    }),
    test_f("Another Test Name", "Message if fails", {
      env.expect_neq<std::string>("a", "b");
    })
  });

  mtEnv.run_all();
  return 0;
}

For more, look into the example folder.

About

Header Only Unit Test Framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published