The CppUnit documentation suggests that runner.addTest
takes ownership of whatever test it's given. By giving runner.addTest
only part of your myTest instance, you're not providing any way for the entire myTest instance to get cleaned up on deletion. Manually delete
'ing myTest after running probably won't work either, since runner
will also try to delete the portion of myTest
that it's been given.
If you're interested in only running a particular test or subset of tests, you should instead try using the testName
parameter of TextRunner::run.
(And if you have the time and inclination, you might want to look into a different unit test framework. UnitTest++ and Google Test are newer, easier to use, and more featureful than CppUnit.)
Josh Kelley
2009-10-29 16:59:25