doctest

[brief]

C++ testing framework for unit tests and TDD

This project is a build2 package repository that provides access to doctest, a C++ testing framework that brings the ability to have tests written directly in the production code thanks to a fast, transparent and flexible test runner with a clean interface.

Official build2 cppget.org queue.cppget.org

Usage

Make sure to add the stable or testing section of the cppget.org repository to your project's repositories.manifest to be able to fetch this package.

:
role: prerequisite
location: https://pkg.cppget.org/1/stable
# trust: ...

If the stable or testing section of cppget.org is not an option then add this Git repository itself instead as a prerequisite.

:
role: prerequisite
location: https://github.com/build2-packaging/doctest.git

Add the respective dependency in your project's manifest file to make the package available for import.

depends: doctest ^2.4.12

To import the library target that already implements the main function, include the following declaration in a buildfile.

import doctest = doctest%lib{doctest-main}

If you want to customize the testing process by providing your own main, use the following header-only library target instead.

import doctest = doctest%lib{doctest}

Configuration

doctest itself already comes with various configuration options. Some of these can be accessed by the package configuration. For an explanation, refer to doctest's configuration documentation. The following variables need to be provided globally and will affect both library targets, lib{doctest} and lib{doctest-main}.

config [bool] config.doctest.disable                 ?= false
config [bool] config.doctest.treat_char_as_string    ?= false
config [bool] config.doctest.use_std_headers         ?= false
config [bool] config.doctest.no_exceptions           ?= false
config [bool] config.doctest.no_contradicting_inline ?= false

The following configuration variables only need to be set for the implementation unit and will only affect the lib{doctest-main} library target. Define their respective pre-processor macros for doctest implementation unit that implement their own main function and only link to lib{doctest}.

config [string] config.doctest.options_prefix      ?= [null]
config [bool] config.doctest.no_unprefixed_options ?= false
config [bool] config.doctest.colors_none           ?= false
config [bool] config.doctest.colors_windows        ?= false
config [bool] config.doctest.colors_ansi           ?= false
config [bool] config.doctest.windows_seh           ?= false
config [bool] config.doctest.no_windows_seh        ?= false
config [bool] config.doctest.posix_signals         ?= false
config [bool] config.doctest.no_posix_signals      ?= false
config [bool] config.doctest.no_multithreading     ?= false
config [bool] config.doctest.no_multi_lane_atomics ?= false

Issues and Notes

Contributing

Thank you in advance for your help and contribution to keep this package up-to-date. Please, file an issue on GitHub for questions, bug reports, or to recommend updating the package version. If you're making a pull request to fix bugs or update the package version yourself, refer to the build2 Packaging Guidelines.

license MIT
project doctest
url github.com/doctest/doctest
9 Versions
version 2.4.12
repository https://pkg.cppget.org/1/testing
depends 0
reviews 0
version 2.4.11
repository https://pkg.cppget.org/1/stable
depends 0
reviews +1
version 2.4.9
repository https://pkg.cppget.org/1/stable
depends 0
requires 1; (c++11 | c++14 | c++17 | c++20)
reviews +1
version 2.4.7
repository https://pkg.cppget.org/1/stable
depends 0
requires 1; (c++11 | c++14 | c++17 | c++20)
reviews +1
version 2.4.6+2
repository https://pkg.cppget.org/1/stable
depends 0
requires 1; (c++11 | c++14 | c++17 | c++20)
reviews +1
version 2.4.10
repository https://pkg.cppget.org/1/stable
depends 0
reviews +1
version 2.4.0
repository https://pkg.cppget.org/1/stable
depends 0
requires 1; (c++11 | c++14 | c++17 | c++20)
reviews +1
version 2.3.6
repository https://pkg.cppget.org/1/stable
depends 0
requires 1; (c++11 | c++14 | c++17 | c++20)
reviews +1
version 2.3.5+1
repository https://pkg.cppget.org/1/stable
depends 0
requires 1; (c++11 | c++14 | c++17 | c++20)
reviews +1