Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 677 Bytes

README.md

File metadata and controls

36 lines (24 loc) · 677 Bytes

Unit Test C++

Header-only simple unit-testing library for C++.

DOI

Usage

Just include test.hpp in your app and use it like in main.cpp:

#include <functional>

#include "test.hpp"

int main() {
    std::vector<std::function<bool()>> test_funcs = {
            []() { return 1 == 1; }, // TEST 1
            []() { return !(1 == 2); },   // TEST 2
            []() { return 1 == 2; } // TEST 3
    };

    Test tests(test_funcs);
    tests.Run();

    return 0;
}

Example result:

Test 3 FAILED
Run completed, # of failed tests/total tests: 1/3