The fastest feature-rich C++11/14/17/20 single-header testing framework

Overview

master branch
dev branch

doctest is a new C++ testing framework but is by far the fastest both in compile times (by orders of magnitude) and runtime compared to other feature-rich alternatives. It brings the ability of compiled languages such as D / Rust / Nim to have tests written directly in the production code thanks to a fast, transparent and flexible test runner with a clean interface.

Standard License download CII Best Practices Language grade: C/C++ Chat - Discord Try it online

The framework is and will stay free but needs your support to sustain its development. There are lots of new features and maintenance to do. If you work for a company using doctest or have the means to do so, please consider financial support. Monthly donations via Patreon and one-offs via PayPal.

A complete example with a self-registering test that compiles to an executable looks like this:

cover-example

There are many C++ testing frameworks - Catch, Boost.Test, UnitTest++, cpputest, googletest and others.

The key differences between it and other testing frameworks are that it is light and unintrusive:

  • Ultra light on compile times both in terms of including the header and writing thousands of asserts
  • Doesn't produce any warnings even on the most aggressive warning levels for MSVC/GCC/Clang
  • Can remove everything testing-related from the binary with the DOCTEST_CONFIG_DISABLE identifier
  • thread-safe - asserts can be used from multiple threads spawned from a single test case - example
  • asserts can be used outside of a testing context - as a general purpose assert library - example
  • No global namespace pollution (everything is in doctest::) & doesn't drag any headers with it
  • Portable C++11 (use tag 1.2.9 for C++98) with over 100 different CI builds (static analysis, sanitizers..)
  • binaries (exe/dll) can use the test runner of another binary => tests in a single registry - example

cost-of-including-the-framework-header

This allows the framework to be used in more ways than any other - tests can be written directly in the production code!

Tests can be a form of documentation and should be able to reside near the production code which they test.

  • This makes the barrier for writing tests much lower - you don't have to: 1) make a separate source file 2) include a bunch of stuff in it 3) add it to the build system and 4) add it to source control - You can just write the tests for a class or a piece of functionality at the bottom of its source file - or even header file!
  • Tests in the production code can be thought of as documentation/up-to-date comments - showcasing the APIs
  • Testing internals that are not exposed through the public API and headers is no longer a mind-bending exercise
  • Test-driven development in C++ has never been easier!

The framework can be used just like any other without mixing production code and tests - check out the features.

doctest is modeled after Catch and some parts of the code have been taken directly - check out the differences.

This table compares doctest / Catch / lest which are all very similar.

Checkout the CppCon 2017 talk on YouTube to get a better understanding of how the framework works and read about how to use it in the JetBrains article - highlighting the unique aspects of the framework! On a short description on how to use the framework along production code you could refer to this GitHub issue. There is also an older article in the february edition of ACCU Overload 2017.

CppCon 2017 talk about doctest on youtube

Documentation

Project:

Usage:

Contributing

Support the development of the project with donations! There is a list of planned features which are all important and big - see the roadmap. I took a break from working in the industry to make open source software so every cent is a big deal.

If you work for a company using doctest or have the means to do so, please consider financial support.

Contributions in the form of issues and pull requests are welcome as well - check out the Contributing page.

Logo

The logo is licensed under a Creative Commons Attribution 4.0 International License. Copyright © 2019 area55git   License: CC BY 4.0

Issues
  • Add Github Actions CI

    Add Github Actions CI

    Opening the pull request so I can start testing the configuration. I've started by taking reproc's Github Actions configuration and removing everything reproc related. Once that works I'll start adding all doctest related configuration.

    opened by DaanDeMeyer 38
  • Regression between 2.4.6 and 2.4.7

    Regression between 2.4.6 and 2.4.7

    Description

    Following minimized code works perfectly on 2.4.6, but fails on 2.4.7

    // #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN shouldn't be defined in compilation unit to reproduce
    #include <doctest/doctest.h>
    
    #include <string>
    
    namespace {
    
    class B
    {
    public:
        const std::string& getName() const
        {
            return m_name;
        }
    
        std::string m_name = "B";
    };
    
    }  // namespace
    
    TEST_CASE("Wtf?") {
        B b;
    
        CHECK(b.getName() == "B");
    }
    

    https://godbolt.org/z/Eq48fjsed (due to the godbolt limitations see "undefined reference to `main'" linker warnings as success)

    Flags: "-std=c++11 -Wall -Wextra -Wpedantic -Werror"

    It fails on GCC version 4.9 - 10.3 with -fpermissive warning. (GCC version 11.2 compiles it without a problem though 🤔)

    doctest/doctest.h: In instantiation of 'void doctest::detail::fillstream(const T (&)[N]) [with T = char; long unsigned int N = 2]':
    doctest/doctest.h:904:31:   required from 'static void doctest::detail::filldata<T [N]>::fill(const T (&)[N]) [with T = const char; long unsigned int N = 2]'
    doctest/doctest.h:918:65:   required from 'void doctest::detail::filloss(const T (&)[N]) [with T = char; long unsigned int N = 2]'
    doctest/doctest.h:933:20:   required from 'static doctest::String doctest::detail::StringMakerBase<true>::convert(const T&) [with T = char [2]]'
    doctest/doctest.h:978:35:   required from 'doctest::String doctest::toString(const T&) [with T = char [2]; typename doctest::detail::enable_if<(! doctest::detail::is_enum<T>::value), bool>::type <anonymous> = true]'
    doctest/doctest.h:1142:45:   required from 'doctest::String doctest::detail::stringifyBinaryExpr(const L&, const char*, const R&) [with L = std::__cxx11::basic_string<char>; R = char [2]]'
    doctest/doctest.h:1320:9:   required from 'decltype (((void)((declval<L>() == declval<R>())), (doctest::detail::Result)(<brace-enclosed initializer list>()))) doctest::detail::Expression_lhs<L>::operator==(const R&) [with R = char [2]; typename doctest::detail::enable_if<(! doctest::detail::is_rvalue_reference<R>::value), void>::type* <anonymous> = 0; L = const std::__cxx11::basic_string<char>&; decltype (((void)((declval<L>() == declval<R>())), (doctest::detail::Result)(<brace-enclosed initializer list>()))) = doctest::detail::Result]'
    <source>:24:5:   required from here
    doctest/doctest.h:896:31: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char, std::char_traits<char> >'} and 'const char')
    doctest/doctest.h:557:33: note: candidate: 'std::ostream& doctest::operator<<(std::ostream&, const doctest::String&)' (near match)
    doctest/doctest.h:557:33: note:   conversion of argument 2 would be ill-formed:
    doctest/doctest.h:896:36: error: invalid user-defined conversion from 'const char' to 'const doctest::String&' [-fpermissive]
    doctest/doctest.h:519:5: note: candidate is: 'doctest::String::String(const char*)' (near match)
    doctest/doctest.h:519:5: note:   conversion of argument 1 would be ill-formed:
    doctest/doctest.h:896:36: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
    doctest/doctest.h:896:36: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
    doctest/doctest.h:519:24: note:   initializing argument 1 of 'doctest::String::String(const char*)'
    In file included from /opt/compiler-explorer/gcc-10.3.0/include/c++/10.3.0/string:55,
                     from <source>:4:
    /opt/compiler-explorer/gcc-10.3.0/include/c++/10.3.0/bits/basic_string.h:6468:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
     6468 |     operator<<(basic_ostream<_CharT, _Traits>& __os,
          |     ^~~~~~~~
    /opt/compiler-explorer/gcc-10.3.0/include/c++/10.3.0/bits/basic_string.h:6468:5: note:   template argument deduction/substitution failed:
    doctest/doctest.h:896:31: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'const char'
    

    It fails on any version of clang, but with an error instead of the warning. It fails on MSVC at least in version 19 that is accessible on Godbolt.

    Using this code as a test, it's possible to bisect a broken commit.

    opened by YarikTH 28
  • Tests inside a static library

    Tests inside a static library

    Hi,

    (This is more a question than an issue) What is the recommended way to add tests inside a static library project ?

    If I compile a library (which includes TEST_CASE(s)) as a static library, and then I try to run the tests from this library by creating a target that links to it, the test suite is actually empty (i.e I guess the tests were stripped at link time)

    Am I doing something wrong, or is there a way to circumvent this?

    Below is an example of what I am trying to achieve (using cmake):

    Project         <- main project
      CMakeLists.txt
      doctest/
        doctest.h
        doctest_main.cpp
      MyLibrary/
        lib1.cpp    <- these files includes actual library code and TEST_CASE(s)
        lib2.cpp    
        lib3.cpp    
        CMakeLists.txt <- will produce two targets : library and its test
      MyMainProgram/
        main.cpp
        CMakeLists.txt
    
    

    MyLibrary/CMakeLists.txt :

        set(sources lib1.cpp lib2.cpp lib3.cpp)
        add_library(MyLibrary STATIC ${sources})
        target_include_directories(MyLibrary PUBLIC ${CMAKE_SOURCE_DIR}/doctest )
    
        # This does not work : it links but the test list is empty !
        add_executable(MyLibrary_DocTest ${CMAKE_SOURCE_DIR}/doctest/doctest_main.cpp)
        target_link_libraries(MyLibrary_DocTest MyLibrary)
    
        # This works, but it requires to re-compile all the source files and to re-define
        # exactly the same compile options as for the library (linked library, compile definition, etc); 
        # this can be tedious
        add_executable(MyLibrary_DocTest ${sources} ${CMAKE_SOURCE_DIR}/doctest/doctest_main.cpp)
    
    

    MyMainProgram/CMakeLists.txt :

        add_executable(MyMainProgram main.cpp)
        target_link_libraries(MyMainProgram MyLibrary)
    

    A working example can be found at https://github.com/pthom/DocTest_LibTest

    opened by pthom 27
  • Count points based on the number of passed/failed cases?

    Count points based on the number of passed/failed cases?

    Hi guys, I am now trying to use doctest to grade c++ code assignments, and this is my first time to use doctest. Just one question, is there any way that I can count the points based on how many testcases are passed? Or is there any way that I can perform like IF test case passed, THEN grade ++, something like that?

    Thanks a lot!

    opened by xrb936 24
  • Doctest is not able to compile on OSX

    Doctest is not able to compile on OSX

    Description

    I am trying to get my Travis CI build working with doctest (I'm switching from Catch to this for performance), but my build is not working on OSX (It is for Linux). In my Travis CI logs, I see the following error:

    Undefined symbols for architecture x86_64:
      "std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<<<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
          doctest::String doctest::detail::stringifyBinaryExpr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [6]>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*, char const (&) [6]) in hello_world_test.cpp.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [test/test_runner] Error 1
    make[1]: *** [test/CMakeFiles/test_runner.dir/all] Error 2
    make: *** [all] Error 2
    

    Steps to reproduce

    I'm using CMake, and my invocation command is:

    cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=$COMPILER -DBUILD_TESTS=ON ..
    

    (COMPILER is set to clang++ and BUILD_TYPE is set to Debug and Release, both of which fail)

    The CMake configuration I am using is (for flags):

    if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
        set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
        set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
    elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
        # ...
    endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    

    And the test configuration:

    set(TEST_SOURCES
        factorial_test.cpp
        hello_world_test.cpp
    )
    
    add_library(doctest INTERFACE)
    target_include_directories(doctest INTERFACE 
        "${CMAKE_SOURCE_DIR}/third_party/doctest" # Contains single header
    )
    
    add_executable(test_runner test_runner.cpp ${TEST_SOURCES})
    target_link_libraries(test_runner Project-Name-lib doctest)
    
    add_test(all_tests test_runner)
    

    Extra information

    • doctest version: v1.2.8
    • Operating System: Travis CI OSX XCode image 9.2
    • Compiler+version: AppleClang 9.0.0.9000039
    opened by arnavb 23
  • Add default printers for enums

    Add default printers for enums

    I've added an assertion for a function returning an enum and the enum value. When the test failed I've got pretty informative failure output {?} == {?}...

    I don't intend to write a custom printer for my enum type, but still want to see readable values when a test fails. I've workaround the problem by casting to int, but I'd prefer if the library does this for me.

    opened by obfuscated 22
  • Logo Proposal for Doctest

    Logo Proposal for Doctest

    Hi, In response to your request for Logo, I am very grateful to be able to collaborate in your project.

    I need a short review about Doctest to start with the sketches. I can improve the existing one or create something totally new and different. You can tell me your suggestions.

    opened by area55git 20
  • [Feature] Better integration with tools (VS Code Test Adapter Extension)

    [Feature] Better integration with tools (VS Code Test Adapter Extension)

    Description

    The "Catch2 and Google Test Explorer" Extension for Visual Studio Code has experimental support for doctest. However, several tests with the same name but in different tests suites can't be run. Also, the test results can't be displayed reliably inline in the source code. This could be fixed if some additional information was available from the command line.

    Could you add the possibility to list the test suites and test cases with file names and line numbers from the command line?

    This would make it possible for the extension to work reliably and give VS Code users much better usability while using doctest.

    See: https://github.com/matepek/vscode-catch2-test-adapter/issues/143#issuecomment-566092840 And: https://github.com/matepek/vscode-catch2-test-adapter/issues/143#issuecomment-566139062

    opened by wilhem-meignan 19
  • Slower than Catch in realistic test cases

    Slower than Catch in realistic test cases

    Hi,

    I did some benchmarking of doctest on my machine (Linux, gcc-4.9.3). I adapted a bit your Python script to work on Linux (with_gcc = 1 and removed the forced CMake generator).

    First, I can confirm that in the simple benchmark case, it is indeed faster to compile than Catch by a large margin. However, this is not a very realistic test case.

    I have modified the benchmark to generate 50 files, each with 25 test cases and each with 10 CHECK (using a variable and not two constants). Here are the results:

    Catch: 1 minute 56 seconds Doctest: 2 minutes 32 seconds

    In a realistic test case, doctest is significantly slower than Catch. I can see the same thing when I replace Catch by doctest in one of my large test case of my ETL library.

    Do you have any idea why this happen ?

    I can only guess that the overhead comes from the templates used to extract lhs and rhs or by the macros generating the test cases.

    opened by wichtounet 19
  • [PROJECT ANNOUNCEMENT] Looking for maintainers for Doctest

    [PROJECT ANNOUNCEMENT] Looking for maintainers for Doctest

    Working on doctest has taught me two very important lessons: how to prioritize and how to say no, and now it's time to apply them to my life. I can no longer maintain doctest properly and that's evident by my inactivity for the past 8 months - I haven't touched C++ professionally in almost 2 years and I've moved on to other things.

    I invite anyone interested in the development & maintenance of the framework to join the Discord server. I just moved doctest to a GitHub organization as suggested here and will add whoever is interested as a member. I'll release a version or two and will stick around for some time as people join in order to resolve any disputes and respond to questions and at some point, I'll promote the ones that have shown the most interest to admins & owners of the repository and the Discord server - I won't leave but I hope that by that time others would be able to reach consensus on contentious issues and I'll redirect any donations to the maintainers once this transition period is over.

    Doctest doesn't require too much work (unless new features are added) - mostly the occasional compiler bugfix & support in issues. The design goals of the framework should be followed - what made doctest successful is the art of saying no and keeping it light & easy to use.

    EDIT: some more info - https://github.com/doctest/doctest/issues/554#issuecomment-991190934

    Best regards, Viktor

    opened by onqtam 18
  • Refactor stringification

    Refactor stringification

    So StringMaker and StringStream act as a pretty much completely parallel structure. This structure will be eradicated. For the first draft I have simply removed the StringMaker's body, attaching it's head to StringStream's body.

    The customization points are broken, as well as a few other features, namely raw memory stringification likely among others.

    This (hopefully) finally fixes #571 for good!

    opened by Saalvage 16
  • enums with ostream<< overloads are printed as their underlying type (as integers)

    enums with ostream<< overloads are printed as their underlying type (as integers)

    Description

    I had some enums where I defined an ostream<< operator, and I want to use it to print my enums rather than printing their underlying value like doctest seems to do by default.

    Steps to reproduce

    enum class Foo {};
    
    std::ostream& operator<<(std::ostream& os, Foo) {
      return os << "Foo";
    }
    
    int main() {
        assert(doctest::toString(Foo()) == "Foo"); // Fails, toString returns "0"
    }
    

    (disclaimer: I have not tested the example code above.)

    Extra information

    I found a workaround but it only works for GCC (see: https://github.com/doctest/doctest/issues/121#issuecomment-1200039472)

    I suggest to tweak doctest's enum printing code so that it only prints enums by their underlying type if they do not meet the requirements of has_insertion_operator.

    opened by nlguillemot 0
  • Reorganising the MPI code and adding a default main() entry to the MPI

    Reorganising the MPI code and adding a default main() entry to the MPI

    Dear, sir

    • Fixed linker error by restructuring the code when tried to use cmake to integrate doctest with mpi.
    • Standardising the style of the code using project .clang-format.
    • Used 'Include Guards' instead of #program once to improve compatibility.
    • Added macro DOCTEST_CONFIG_IMPLEMENT_WITH_MPI_MAIN to provide a default main entry for mpi tests.
    • Markdown documentation has also been updated.

    Thanks for open sourcing this useful library.

    opened by jokervTv 2
  • (v2.4.8) Log output does not automatically create directory when it doesn't exist

    (v2.4.8) Log output does not automatically create directory when it doesn't exist

    Description

    When running with -r=junit -o=reports/log.xml, if reports folder does not exist, no xml file will be actually generated. I am not sure what's behind this behavior, but gtest framework will create the folder if it doesn't exist.

    Steps to reproduce

    just run the exe with -r=junit -o=reports/log.xml

    Extra information

    • doctest version: v2.4.8
    • Operating System: ubuntu 18.04
    • Compiler+version: gcc 7.5
    opened by OneOfTheirs 2
  • doctest 2.4.9: function pointer comparison does not compile any more

    doctest 2.4.9: function pointer comparison does not compile any more

    Description

    Since version 2.4.9 function pointers seem to be compared differently. If you compile the following example, you will get the error

    /usr/local/include/doctest/doctest.h:1166:49: Cannot initialize a parameter of type 'const void *' with an lvalue of type 'void (*)()'
    

    This seems to be similar as https://github.com/doctest/doctest/issues/665#issue-1279903353

    Steps to reproduce

    void function() {}
    
    DOCTEST_TEST_CASE("function pointer equality test")
    {
        void (*function_pointer)() = &function;
        
        DOCTEST_CHECK(function_pointer == &function); // compile error
    }
    

    Extra information

    • doctest version: v2.4.9
    • Operating System: OSX
    • Compiler+version: Apple clang version 13.1.6 (clang-1316.0.21.2.5)
    opened by ascii255 0
  • Error including DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING

    Error including DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING

    Description

    I'd like to compare C strings but when defining DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING the compiler throws this error:

    /usr/local/include/doctest.h:1278:89: error: ‘value’ does not name a type; did you mean ‘si_value’?
     1278 |     template<class T>   struct not_char_pointer              { static DOCTEST_CONSTEXPR value = 1; };
          |                                                                                         ^~~~~
          |                                                                                         si_value
    /usr/local/include/doctest.h:1279:89: error: ‘value’ does not name a type; did you mean ‘si_value’?
     1279 |     template<>          struct not_char_pointer<char*>       { static DOCTEST_CONSTEXPR value = 0; };
          |                                                                                         ^~~~~
          |                                                                                         si_value
    /usr/local/include/doctest.h:1280:89: error: ‘value’ does not name a type; did you mean ‘si_value’?
     1280 |     template<>          struct not_char_pointer<const char*> { static DOCTEST_CONSTEXPR value = 0; };
          |                                                                                         ^~~~~
          |                                                                                         si_value
    ninja: build stopped: subcommand failed.
    
    

    Btw, it would be nice to have a specific assert for C strings. Maybe something like {REQUIRE|CHECK}_C_STRING_{EQ|NE}(actual, expected).

    Steps to reproduce

    Include in one file:

    #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
    #define DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
    #include <doctest.h>
    

    Test suites are defined in other files.

    Extra information

    • doctest version: v2.4.9
    • Operating System: Pop OS 22.04
    • Compiler+version: g++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0
    opened by RaniAgus 0
  • Clang in MSVC mode broken in 2.4.9

    Clang in MSVC mode broken in 2.4.9

    Description

    After updating doctest to 2.4.9, it broke clang in msvc mode again. e8ba771d4b4cf90cb99e011ef01059dd6533d39c introduced some changes, using ::operator<< in stringification, possibly to workaround msvc bugs, but it causes bugs in clang instead:

    doctest.h:978:56: error: no member named 'operator<<' in the global namespace
        struct has_global_insertion_operator<T, decltype(::operator<<(declval<std::ostream&>(), declval<const T&>()), void())> : types::true_type { };
                                                         ~~^
    1 error generated.
    

    https://github.com/doctest/doctest/blob/b7c21ec5ceeadb4951b00396fc1e4642dd347e5f/doctest/doctest.h#L973 https://github.com/doctest/doctest/blob/b7c21ec5ceeadb4951b00396fc1e4642dd347e5f/doctest/doctest.h#L1124 Replacing these #ifs with #if !DOCTEST_CLANG && (defined(_MSC_VER) && _MSC_VER <= 1900) seem to fix the problem for me.

    Steps to reproduce

    Just include the doctest header.

    Extra information

    • doctest version: v2.4.9
    • Operating System: Gentoo linux
    • Compiler+version: clang 8.0.1 with msvc12 stdlibs
    opened by u3shit 0
Releases(v2.4.9)
Owner
The fastest feature-rich C++11/14/17/20 single-header testing framework
null
C++ Unit Testing Easier: A Header-only C++ unit testing framework

CUTE C++ Unit Testing Easier: A Header-only C++ unit testing framework usually available as part of the Cevelop C++ IDE (http://cevelop.com) Dependenc

Peter Sommerlad 34 Jul 22, 2022
The C Unit Testing Library on GitHub is a library designed for easy unit testing in C

The C Unit Testing Library on GitHub is a library designed for easy unit testing in C. It was written by Brennan Hurst for the purpose of providing a J-Unit-like testing framework within C for personal projects.

null 1 Oct 11, 2021
A complete unit testing framework in a header

liblittletest A complete unit testing framework in a header liblittletest is an easy to use all-in-an-header testing framework; all you have to do in

Sebastiano Merlino 13 Nov 11, 2021
A modern, C++11-native, single-file header-only, tiny framework for unit-tests, TDD and BDD (includes C++98 variant)

lest – lest errors escape testing This tiny C++11 test framework is based on ideas and examples by Kevlin Henney [1,2] and on ideas found in the CATCH

Martin Moene 345 Jul 10, 2022
Upp11 - C++11 lightweight single header unit test framework

upp11 Lightweight C++11 single header unit test framework To use framework: Copy upp11.h in you project dir. Create unit test source files or modify e

Andrey Valyaev 8 Apr 4, 2019
Header-only C++11 library for property-based testing.

autocheck Header-only C++11 library for QuickCheck (and later, SmallCheck) testing. Please consult the wiki for documentation. Install conan remote ad

John Freeman 119 Apr 18, 2022
Googletest - Google Testing and Mocking Framework

GoogleTest OSS Builds Status Announcements Release 1.10.x Release 1.10.x is now available. Coming Soon Post 1.10.x googletest will follow Abseil Live

Google 27.1k Aug 3, 2022
C++ xUnit-like testing framework without macros

tst C++ testing framework. Installation, documentation, tutorials See WiKi. Features xUnit-like concepts minimal use of preprocessor macros declarativ

cppfw 8 Jan 24, 2022
c++ testing framework

iutest iutest - iris unit test framework Welcome to the iutest iutest is framework for writing C++ tests. Features An XUnit test framework. Header onl

srz_zumix 59 Jun 15, 2022
UT: C++20 μ(micro)/Unit Testing Framework

"If you liked it then you "should have put a"_test on it", Beyonce rule UT / μt | Motivation | Quick Start | Overview | Tutorial | Examples | User Gui

boost::ext 888 Aug 7, 2022
Modern c++17 unit testing framework on Microsoft Windows, Apple macOS, Linux, iOS and android.

tunit Modern c++17 unit testing framework on Windows, macOS, Linux, iOS and android. Continuous Integration build status Operating system Status Windo

Gammasoft 8 Apr 5, 2022
Simple C testing framework

MrTest Simple C testing framework Usage Copy the mrtest.c and mrtest.h file into your project. In order to use the mrtest main: create a .c file that

Maarten Raasveldt 2 Jul 20, 2022
xtest is a C++ testing framework inspired by googletest.

xtest C++ testing framework inspired by googletest Explore the docs » Wiki · Report Bug · Request Feature Contents xtest Commence Prerequisites Ubuntu

Ayush Joshi 2 Jul 9, 2022
A minimal testing framework for C/C++

mtest About mtest is a minimal testing framework for C++. Requirements Windows or UNIX-like host A compiler supporting C++11 Usage To include mtest in

Justin S 1 Jan 10, 2022
Kernel-mode C++ unit testing framework in BDD-style

There is a lack of unit testing frameworks that work in OS kernel. This library closes that gap and is targeted for windows driver developers.

Sergey Podobry 40 Jun 11, 2022
Simple, fast, accurate single-header microbenchmarking functionality for C++11/14/17/20

ankerl::nanobench ankerl::nanobench is a platform independent microbenchmarking library for C++11/14/17/20. #includ

Martin Leitner-Ankerl 798 Jul 28, 2022
Practical mutation testing tool for C and C++

Mull Mull is a tool for Mutation Testing based on LLVM/Clang with a strong focus on C and C++ languages. For installation and usage please refer to th

Mull Project 635 Jul 30, 2022
proftest is a C application for testing the quality of different operating system APIs for profiling.

proftest is a C application for testing the quality of different operating system APIs for profiling.

Felix Geisendörfer 5 Jul 23, 2021
A micro unit-testing library for C/C++

µ-test A micro unit testing framework for C/C++ to get you up and running with unit-testing ASAP (even without libc). Usage Simply include the C and h

Trevor McKay 1 Dec 8, 2021