EasyTest++

EasyTest++ is a lightweight and easy to use C++ unit testing framework released under the MIT license.

Why to use it ?


How to use it ?

Download the latest release and extract it to a folder named EasyTest++.

Write your first unit test suite: MyTestSuite.cpp.

#include <easyTest.h>

TEST_SUITE(MyTestSuite)
{
    TEST_CASE(addition);
    TEST_CASE(division);
};

TEST_IMPL(MyTestSuite, addition)
{
    ASSERT_EQUAL(1 + 1, 2);
    return true;
}

TEST_IMPL(MyTestSuite, division)
{
    ASSERT_ALMOST_EQUAL(1.0 / 3.0, 0.3333, 0.0001);
    TRACE("no issue with doubles");

    ASSERT_ALMOST_EQUAL(1.f / 3.f, 0.333f, 0.001f);
    TRACE("no issue with floats");

    return true;
}

Build the test runner and you're ready!

$ g++ -std=c++11 -I./EasyTest++/include -o Test_MyTestSuite MyTestSuite.cpp -pthread -L./EasyTest++/lib -lEasyTest++_linux64
$ ./Test_MyTestSuite -sv

Want to know more ?

Just go to the GitHub project page.

You will find detailed information about how to build EasyTest++ yourself and how to use it.

If you have any question, any issue or great ideas to make it better, please post an issue on the project page.