C++ Unit Testing Easier: A Header-only C++ unit testing framework

Owner
Peter Sommerlad
Peter Sommerlad is a consultant and trainer for Safe & Modern C++ and Agile Software Engineering. Peter was professor and director of @IFS-HSR
Peter Sommerlad
Comments
  • Build errors

    Build errors

    Hello, I installed the Eclipse plugin, created a new Cute Project Suite inside my workspace (with one existing project, the one I want to write unit tests for), but I get more than 2K build errors, all of them like the following one: /home/daniele/eclipse-workspace/Biscottest/cute/cute_equals.h:89:3: error: template with C linkage template <typename ExpectedValue, typename ActualValue, bool select_non_integral_type> ^~~~~~~~ I'm using GNU Make build with ARM GCC/G++ compiler (gcc-arm-none-eabi-6-2017-q4-major).

    I guess it's something about project configuration, but I can't find what.

    Regards, Daniele

  • Indexed ASSERT's and checked throws

    Indexed ASSERT's and checked throws

    Hi, I've added a couple of features that I find useful for my data-driven tests.

    The first one is an ability to include an index reference into the failure messages while keeping the (autogenerated) condition message intact. Please see a usage example in the testIndexed() function.

    The second one is an ability to provide a specific code for checking properties of a thrown message. So that not only the fact of the given exception being thrown is checked, but e.g. a status code can be also verified. Please see a usage example in the testCheckedThrow() function.

  • add exit-code to simpletest.cpp example

    add exit-code to simpletest.cpp example

    Always have an exit-code. Otherwise it is useless to wrap inside other test-harnesses such as cmake's ctest and others (which depend on the executables' exit code [0 for success])

  • flush stream after newline in the ide listener

    flush stream after newline in the ide listener

    • Updated version from 2.2.1 to 2.2.2
    • Always flushes the stream after a newline in the ide_listener.h file
    • Replace existing std::endl with '\n' << std::flush to be consistent
  • Implement TAP listener

    Implement TAP listener

    The Test Anything Protocol (TAP) is a test output protocol originally created for Perl. Over the years, TAP has been adopted by various languages and testing infrastructures. TAP is supported by different test harnesses and can be used for automatic test result processing in Jenkins, Automake, and others.

    The tap_listener implements TAP version 12 which, according to the specification, is considered the current release.

  • Fix demangling for GNU's libstdc++ C++11 ABI

    Fix demangling for GNU's libstdc++ C++11 ABI

    When using the C++11 ABI, GNU's libstdc++ puts some classes, most notably map, into an inline namespace _GLIBCXX_USE_CXX11_ABI. This broke four of CUTE's own unit tests.

  • Match tuple output format with the one of vector

    Match tuple output format with the one of vector

    CUTE prints each element of a std::vector on its own separate line. This makes reading the diff in CDT much easier. This patchset changes the output function for std::tuple<T...> to do the same thing.

  • Remove reference to parameter in default value

    Remove reference to parameter in default value

    ISO-14882:2014 (and as far as I can tell also the prior versions) forbids the use of function parameters in the initializer-clause of a parameter-declaration (see dcl.fct.default). Even though this general ban was lifted a little bit - by allowing usage in non-evaluated contexts - in CWG2082, this change does not apply here.

Related tags
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

Nov 11, 2021
A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD - using C++11, C++14, C++17 and later (or C++03 on the Catch1.x branch)
A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD - using C++11, C++14, C++17 and later (or C++03 on the Catch1.x branch)

Catch2 v3 is being developed! You are on the devel branch, where the next major version, v3, of Catch2 is being developed. As it is a significant rewo

Sep 26, 2022
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

Sep 19, 2022
UT: C++20 μ(micro)/Unit Testing Framework
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

Sep 28, 2022
Modern c++17 unit testing framework on Microsoft Windows, Apple macOS, Linux, iOS and android.
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

Apr 5, 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.

Jun 11, 2022
C unit tests with a small header-only library.
C unit tests with a small header-only library.

C unit tests Minimalistic unit tests in C. Uses the __attribute__((constructor)) which, as far as I know, is supported by GCC and clang. So this proba

Aug 28, 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

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

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

master branch Windows All dev branch Windows All doctest is a new C++ testing framework but is by far the fastest both in compile times (by orders of

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

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 c

Sep 29, 2022
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

Dec 8, 2021
Header only C++14 mocking framework
Header only C++14 mocking framework

Trompeloeil Get: trompe l'oeil noun (Concise Encyclopedia) Style of representation in which a painted object is intended to deceive the viewer into be

Sep 23, 2022
Various Framework to do Unit Test in C++
Various Framework to do Unit Test in C++

Unit Test in C++ There are many frameworks to performs unit test in C++, we will present the most popular ones and show how to use them. The testing f

Nov 18, 2021
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

Sep 24, 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

Sep 26, 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

Sep 12, 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

Jul 20, 2022
xtest is a C++ testing framework inspired by googletest.
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

Jul 9, 2022