doctest
Google Mock | doctest | |
---|---|---|
- | 20 | |
- | 6,046 | |
- | 1.4% | |
- | 0.0 | |
- | about 2 months ago | |
C++ | ||
- | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Google Mock
We haven't tracked posts mentioning Google Mock yet.
Tracking mentions began in Dec 2020.
doctest
-
The Two Factions of C++
catch2 has become fairly bloated. doctest takes all of the best parts of catch2 without all the bloat and the end result is a test framework that is literally over 10x faster than catch2. It's also like 90% compatible with catch2 so porting your tests to it is pretty easy.
Especially if you have a build process that always runs your unit tests, it's nice to have a very fast test/compile/debug loop.
https://github.com/doctest/doctest
-
Unit testing tool suggestions
I have never used "tools" for unit-tests, only web sites that show the results of the tests or code coverage. For C++ I prefer https://github.com/doctest/doctest but most companies I worked for use Catch2.
-
Question about Doctest.h
Do the README and tutorial not explain it well enough? It's a framework for automated unit testing.
- Doctest – C++ Testing Framework
-
Memory Safety in the D Programming Language (Part 2 of N)
This is, honestly, super easy to get going. Nowadays you have a ton of libraries and more-than-decent build systems. With Meson/CMake and Conan/Vcpkg I can set up a project with testing in 3 minutes. Also, I think that at the end of the day you want your tests to live somewhere else. But if you want to embed them, you also have https://github.com/doctest/doctest.
-
how can I improve my connect4 board class?
Write some tests. They can find bugs early and give you confidence that your code works so far. That doesn't have to be anything fancy, e.g. with doctest:
-
Testing framework Catch2 3.0 final released
Keep in mind https://github.com/doctest/doctest/issues/554. Also, doctest lacks: - Matchers - Data generators - Benchmarking - ...
-
Check if my code meets the requirements?
Your requirements can easily simulated on paper (like increase the speed once, twice, ...), then translated to unit-tests with a framework like https://github.com/doctest/doctest.
- The Lisp Curse
-
C++17 python like print function
For stuff like this which is very easy to test (very predefined input vs output), I highly suggest using some testing framework. Catch2 is great, but there is also doctest and good ole googletest. If you do this, it would also be a great intro to CI, where you do some plumbing on github or gitlab where every commit causes a build to happen on their servers and run through the unit tests, and if it passes it gets merged into master.
What are some alternatives?
Catch - A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)
fff - A testing micro framework for creating function test doubles
Google Test - GoogleTest - Google Testing and Mocking Framework
CppUTest - CppUTest unit testing and mocking framework for C/C++
Boost.Test - The reference C++ unit testing framework (TDD, xUnit, C++03/11/14/17)
CppUnit - C++ port of JUnit
Unity Test API - Simple Unit Testing for C
benchmark - A microbenchmark support library