Question posted on stackexchange:
I learnt about the check testing framework today that seems good. This far I've scripted tests that uses valgrind so that the tests both display output from the tests and from valgrind. Is there a disadvantage in using many test frameworks like valgrind testing for internal memory management, check testing for unit tests and scripts for integration and regression tests? I didn't begin yet writing tests with check and if you know a good/"better" framework for testing C code then please let me know.
This is how my test looks like so far, a script that tests my command-line program including output from valgrind.
If I already can do this with a script, will I even need the check testing framework?
Your certainly on the right track. For my projects I use:
"check" to unit test all method (including as many code paths as I can - have time for). This runs super fast and gives me confidence that the parts of my application are doing what I expect.
"Valgrind" to check the memory usage of the final application while running system/regression tests. This is really really slow, but give me confidence that my application has the desired functionality and the interactions between the methods that make up the application are not causing any unforeseen memory management issues.
So, my advice - do both. Good luck.