TDD
examc
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.
TDD
-
static_assert is all you need (no leaks, no UB)
Keep tests and code separate, and use tdd: https://github.com/yellowdragonlabs/TDD
I usually have dozens/hundreds of tests that run faster than you can compile #include .
All tests are executed automatically every time I save. It's very nice to watch the output while coding, with almost no latency.
- TDD – the fastest C++ test system, with private access
examc
-
static_assert is all you need (no leaks, no UB)
There are other ways to do this. I made a proof of concept of using linker sections to allow you to sprinkle tests within the implementation inline once... https://github.com/cozzyd/examc (this is obviously not production-ready, just serves as a proof of concept).
Basically the idea is that the test code gets written to a different linker section that your test runner can iterate through, when tests are enabled.
-
Running C unit tests with pytest
Indeed, I just made a POC with compiler sections: https://github.com/cozzyd/examc
This implementation only works with gcc though probably (it uses the automatic __start_SECTION and __stop_SECTION that gcc generates but clang doesn't seem to... there are likely hacks to make this work anyway though).
What are some alternatives?
testo - End-to-end-tests automation framework
c_unit_tests - C unit tests with a small header-only library.
samples
templight - Templight is a Clang-based tool to profile the time and memory consumption of template instantiations and to perform interactive debugging sessions to gain introspection into the template instantiation process.
docker-images - Docker images for ci testing
doctest - The fastest feature-rich C++11/14/17/20/23 single-header testing framework
headlock - An adapter for making C code testable from Python (see https://headlock.readthedocs.io/en/latest)
pptest - An abstract reporting header-only unit-testing library for C++.
clean-test - A modern C++-20 testing framework.