> The test infrastructures I build catch memory leaks all of time [...]
Could you elaborate on that, please? I'm curious. Thank you in advance!
Could you elaborate on that, please? I'm curious. Thank you in advance!
But in general, no matter the project, you need a few key pieces:
1. A test suite that thoroughly exercises the code. You'll need this for...
2. A tool such as valgrind to watch memory as your tests in #1 run. Build time, ad hoc, stick in the pipeline anywhere you like.
3. A static analyzer to take a first pass at the code and say, "hmm, this might leak/crash/kill puppies." So, yeah, the order is off as this should be the first thing you do. It can run on your dev machine or on the build machine. Expect lots of false positives.
(optional) 4. A code coverage tool to make sure you're not missing key pieces of code that need exercise.