examc
c_unit_tests
examc | c_unit_tests | |
---|---|---|
2 | 1 | |
0 | 63 | |
- | - | |
0.0 | 3.1 | |
over 2 years ago | 5 months ago | |
C | C | |
MIT License | 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.
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).
c_unit_tests
-
Running C unit tests with pytest
Shameless self-plug since I recently made a small header-only C testing "framework":
https://github.com/rubenvannieuwpoort/c_unit_tests
What are some alternatives?
TDD - See while you code
hypothesis - Hypothesis is a powerful, flexible, and easy to use library for property-based testing.
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.
time-machine - Travel through time in your tests.
docker-images - Docker images for ci testing
headlock - An adapter for making C code testable from Python (see https://headlock.readthedocs.io/en/latest)