
Hi!
However, Boost.Test doesn't return non-zero error code when leaks detected (as it does this when tests fail).
How can I make my testing program to return non-zero error code if memory leaked?
Because Boost.Test does not contain anything that can test for memory leaks. You might want to use something like Google's tcmalloc and so forth as it can tell you about all that, and you can just add a Boost.Test testcase at the end of the tests to check for memory leaks using it.
Boost.Test does contain something to test memory leaks since I get such warnings when I loose memory in my Boost.Test-based program :) I know this is _CRT functions (I use MSVC9). And the function, which Boost.Test uses to inform about leaks under Windows, SIGNALS that we have m-leaks in a program. Moreover, Boost.Test can control this function using (to use or not to use). So I expected that Boost.Test can use this function return code and increase errors counter for leaks. If it cannot, this can be improvement for the future. WBR, Vasily P.S. _CrtDumpMemoryLeaks?