All Projects → onqtam → Doctest

onqtam / Doctest

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

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
python
139335 projects - #7 most used programming language
Starlark
911 projects
Batchfile
5799 projects
Meson
512 projects

Projects that are alternatives of or similar to Doctest

doctest
The fastest feature-rich C++11/14/17/20 single-header testing framework
Stars: ✭ 4,434 (+24.27%)
Mutual labels:  unit-testing, tdd, doctest, testing-framework, cpp20
tau
A Micro (1k lines of code) Unit Test Framework for C/C++
Stars: ✭ 121 (-96.61%)
Mutual labels:  unit-testing, testing-framework, cpp20
Awesome Unit Testing Swift
A curated collection of awesome blog articles, books, talks, podcasts, tools/frameworks and examples.
Stars: ✭ 272 (-92.38%)
Mutual labels:  unit-testing, tdd, testing-framework
Ut
UT: C++20 μ(micro)/Unit Testing Framework
Stars: ✭ 507 (-85.79%)
Mutual labels:  unit-testing, tdd, testing-framework
test-drive
The simple testing framework
Stars: ✭ 37 (-98.96%)
Mutual labels:  unit-testing, testing-framework
eat
Json based scenario testing tool(which can have test for functional and non-functional)
Stars: ✭ 41 (-98.85%)
Mutual labels:  unit-testing, testing-framework
PixelTest
Fast, modern, simple iOS snapshot testing written purely in Swift.
Stars: ✭ 56 (-98.43%)
Mutual labels:  tdd, testing-framework
oletus
Minimal ECMAScript Module test runner
Stars: ✭ 43 (-98.79%)
Mutual labels:  unit-testing, tdd
utest
Lightweight unit testing framework for C/C++ projects. Suitable for embedded devices.
Stars: ✭ 18 (-99.5%)
Mutual labels:  unit-testing, tdd
SimplyVBUnit
The SimplyVBUnit framework provides powerful unit-testing capabilities for VB6.
Stars: ✭ 28 (-99.22%)
Mutual labels:  unit-testing, tdd
iutest
c++ testing framework
Stars: ✭ 58 (-98.37%)
Mutual labels:  tdd, testing-framework
Wasmite
Now WebAssembly has proper testing, unit-testing and debugging 🤗
Stars: ✭ 20 (-99.44%)
Mutual labels:  unit-testing, testing-framework
cpptest
🛠️ Powerful, yet simple, C++ unit testing framework; new home after https://sourceforge.net/projects/cpptest/
Stars: ✭ 51 (-98.57%)
Mutual labels:  unit-testing, testing-framework
testza
Full-featured test framework for Go! Assertions, fuzzing, input testing, output capturing, and much more! 🍕
Stars: ✭ 409 (-88.54%)
Mutual labels:  unit-testing, testing-framework
chai-exclude
Exclude keys to compare from a deep equal operation with chai expect or assert.
Stars: ✭ 33 (-99.08%)
Mutual labels:  unit-testing, tdd
book-fullstack-react-with-typescript
Working through the code samples from Fullstack React with Typescript by Maksim Ivanov and Alex Bespoyasov
Stars: ✭ 52 (-98.54%)
Mutual labels:  unit-testing, tdd
automock
A library for testing classes with auto mocking capabilities using jest-mock-extended
Stars: ✭ 26 (-99.27%)
Mutual labels:  unit-testing, tdd
Quiz App
A repository reflecting the progress made on the "How to Build iOS Apps with Swift, TDD & Clean Architecture" YouTube series, by Caio & Mike.
Stars: ✭ 230 (-93.55%)
Mutual labels:  unit-testing, tdd
Alsatian
TypeScript testing framework with test cases
Stars: ✭ 244 (-93.16%)
Mutual labels:  unit-testing, tdd
tdd roman csharp
Kata: TDD Arabic to Roman Numerals with C#
Stars: ✭ 14 (-99.61%)
Mutual labels:  unit-testing, tdd

master branch All
dev branch All

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

>> doctest is looking for maintainers <<

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].