Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the standard practice for memory leak detect with Google Test framework(not windows)

I have a metric ton of Unit Tests using Google Test.

Currently using XCode, I have noticed some other testing frameworks that detect memory leaks at the end of each unit test, and I assume there is a prescribed way to do the same thing with Google Test. I hope this isn't a feature of Boost Test and a few others only.

If anyone could point me in the right direction, I would appreciate it. Rather avoid switching test frameworks.

Right now, I'm thinking valgrind might be worth looking into, I'm just unsure how I'll hook into each test. My guess is I won't be able to do this from xcode directly.

like image 813
deliberative assembly Avatar asked Sep 06 '13 01:09

deliberative assembly


1 Answers

As far as I know, unit tests for memory leaks are not explicitly supported in Google Test. Nevertheless, you have this extension that fills that part for you

like image 78
jpmuc Avatar answered Oct 03 '22 19:10

jpmuc