How to generate a valgrind suppression file from `ctest -D NightlyMemCheck` command

Hello,
I run ctest -D NightlyMemCheck on around 1800 unit tests. I would like to generate a valgrind suppression file from this command. What is the best way of doing this? For the valgrind command itself, there is

--gen-suppressions=all --log-file=FOO.log

but how can I pass this to ctest so that it will generate a single suppression log file for all of my unit tests ?

I don’t think there’s a way to have all of them write to the same log file (certainly not in a parallel build due to no ordering between the various write() calls) as I believe --log-file= truncates its output before writing. I think you’ll have to add a per-test output log, but I can’t remember if there’s a way to make CTest do that for you for each test distinctly.

1 Like