static_assert is all you need (no leaks, no UB)

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • TDD

    See while you code

  • 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.

  • 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.

  • IMHO the best approach is to avoid the problem by applying TDD. Then there is very little need to debug anything. But otherwise, there is https://github.com/mikael-s-persson/templight for compile-time debugging which is pretty cool and having something like `expect(auto... args) static_asert(args...); assert(args...);` may help with being able to debug at run-time and get the coverage (though, the code has has to compile aka pass first).

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • examc

    proof of concept C unit test library using linker sections

  • 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.

  • samples

  • You can now specify a directory, see README. Any other arguments are just passed to the compiler.

    Here's a sample to play with: https://github.com/yellowdragonlabs/samples/blob/master/tdd_...

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts