Valgrind automatic tests — are they used somewhere?

人走茶凉 提交于 2019-12-21 20:21:21

问题


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:

  1. 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)
  2. Valgrind can also output XML for memcheck ( the --xml=yes option)
  3. Use Expect http://en.wikipedia.org/wiki/Expect to automate your commandline valgrind actions and inspect the output
  4. Write shell scripts that run valgrind and grep the output
  5. 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!



来源:https://stackoverflow.com/questions/912976/valgrind-automatic-tests-are-they-used-somewhere

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!