|
From: Avery P. <ape...@ni...> - 2004-01-27 01:51:38
|
On Tue, Jan 27, 2004 at 09:31:17AM +0900, Darren Cook wrote: > Is there a commandline option to do this? Or does anyone already have a > bash script or similar to filter output? [...] > $ valgrind -q --leak-check=yes ./9.do_nothing_1.exe > ==1548== searching for pointers to 3 not-freed blocks. > ==1548== checked 4575400 bytes. > ==1548== > ==1548== LEAK SUMMARY: Well, obviously filtering the output is rather trivial; first of all, your program's output goes to stdout (probably), while valgrind's goes to stderr. So you can just ignore the whole problem and pipe your program into your output detector as you normally would. valgrind myprogram | checkforjunk You could also do this, if you really need the stderr: valgrind myprogram 2>&1 | tee logfile.out \ | grep -v '^==[0-9]*==' | checkforjunk Or you could do what we do in our new-style wvstreams unit tests, and actually use valgrind's API (see the docs), explicitly checking valgrind's error count occasionally and reporting a failed test if valgrind's output isn't as expected. Good luck, Avery |