Do you think that running set of automatic tests based on valgrind's tool suite makes sense? Did you hear about or see such setup in action? What automatic (free from human intuition) actions could such setup perform?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
This would make sense if you were checking for memory problems / bad code as part of unit testing or final build testing. There may be two approaches:
- writing a test tool that will use valgrind's API through its library, pretty much creating a custom front-end replacing the valgrind executable (seems like a headache)
- Valgrind can also output XML for memcheck ( the --xml=yes option)
- Use Expect http://en.wikipedia.org/wiki/Expect to automate your commandline valgrind actions and inspect the output
- Write shell scripts that run valgrind and grep the output
- Maybe look into adding this functionality to something like DejaGNU which uses expect and tcl
Maybe these tools could automatically create bug items in your tracker (although it might fill up quickly).
Not seen anything myself, but as a valgrind user, it would be handy. If you create something cool, maybe launch it as an open-source project!
edit after a bit of googling I found http://www.redhat.com/f/summitfiles/presentation/June2/Developer%20Tools/Cox,Malcom_Automated%20Testing.pdf
Which seems to cover automated testing using DejaGNU and Valgrind as I suggested above
Good Luck!