C++ xUnit-like testing framework without macros

releases

ci status

tst

C++ testing framework.

Installation, documentation, tutorials

See WiKi.

Features

  • xUnit-like concepts

  • minimal use of preprocessor macros

  • declarative definition of test cases

  • test suites

  • parametrized test cases

  • disabled test cases

  • parallel test execution

  • tests discovery (list existing test cases)

  • run list (list of test cases to run)

  • JUnit XML report generation

  • custom command line arguments

  • colored console output

Why another C++ xUnit framework?

There is already a plenty of C++ testing frameworks. The most popular ones are GoogleTest, Catch2 and Boost.UT.

So why another one?

Well, the good coding exercise is not the last reason, but also the following ones which make tst different:

  • tst minimizes use of preprocessor macros. It is designed with keeping in mind the future use of std::source_location when it becomes widely supported by compilers. Then it will be possible to avoid using macros at all without much rewriting of existing tests. Right now, essentially only one small macro is required, which is SL. For the sake of justice, Boost.UT also works without macros.

  • tst does not require C++'20 yet (unlike Boost.UT). Works with C++'17 which is well supported by existing compilers.

  • tst takes in use latest C++ concepts without being limited by supporting legacy standards.

  • Simple and clean procedural approach to testing (no awkward BDD, Gherkin, etc. stuff).

  • Exception-based "assertions" (check() functions).

  • Built-in parallel test cases execution.

Owner
cppfw
C++ framework
cppfw
Similar Resources

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.

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

Jan 5, 2023

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

Dec 22, 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

Dec 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.

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

Dec 8, 2021

A tool to help in testing client/server robustness in the presence of malformed data.

Tool to assist in testing robustness of network-attached services in the presence of malformed data.

Aug 27, 2022

Bayesian A/B testing calculations for C++

BayesTest C++ Bayesian A/B testing calculations for C++ Based on this post by Evan Miller Also available in Rust Installation Include the header in yo

Nov 14, 2022

5G core testing solution

CoreScope CoreScope combines gNodeB and UE components without any radio transmission. It behaves like a UE and exposes an IP interface, but to the cor

Oct 21, 2022
Comments
  • Add --jobs special value

    Add --jobs special value

    Change the special values accepted by --jobs flag.

    Instead of 0 meaning infinite threads, do the folowing:

    • positive non-zero number = explicit number of threads
    • max = maximum number of threads
    • auto = set number of threads to the number of cores on the system
  • do not print warnings when listing tests

    do not print warnings when listing tests

    Steps: . build all: make . list tests from basic test app: tests/basic/out/rel/tests --list-tests

    Result: two warnings:

    warning: some test set for suite 'empty_suite' is empty
    warning: suite 'empty_suite' is empty
    

    are printed before the tests list

    Expected result: when listing tests, there should be no warnings printed

  • could you help to support bazel?

    could you help to support bazel?

    Could you support bazel , so someone using bazel for their cpp project could import it in his WORKSPACE like:

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "libstst", urls = ["https://github.com/ccpfw/tst/archive/{sha256_hash_value}.zip"], )

  • Add source location to suite::add

    Add source location to suite::add

    For C++20, add source_location argument to suite::add() and report test location to junit test report and test discovery list. Same as the last argument of tst::check() functions.

    Need to figure out how to report test case location in junit report.

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.

Oct 11, 2021
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

Jan 4, 2023
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

Jan 9, 2023
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
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

Jan 3, 2023
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
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
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

Dec 13, 2022
A minimal testing framework for C/C++
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

Jan 10, 2022