Hi Bas,
Thanks for your reply. FYI, we do not use CppUMock widely at the moment - we tend to use FFF fakes and validate later.
The use case is that we have a lot of historic code where we have retrofitted unit-tests and, in some cases, we have a common function that most tests call to check the unit state is still consistent. When this fails, it is clear what the detail of the failure is but the dev will, almost invariably, need to dig around in the debugger to understand the broader nature of the issue.
Currently, they have to re-run the test-suite (outside of our build system) in the debugger, putting a breakpoint in the test; when that breaks, put a breakpoint in the common validation function; if that is in a loop, keep running until you hit the check that fails or define a conditional breakpoint. They could put a breakpoint in
NormalTestTerminator::exitCurrentTest() but I would rather that developers didn't need to rummage around inside the source of CppUTest.
What I would like to provide is for the build system (if in debug mode or optionally in some other way)
to
run the test suite with the -b argument. This means that, when the test fails,
NormalTestTerminator::exitCurrentTest() calls abort() and the JIT debugger kicks in. I've confirmed that calling abort() at that point does do the right thing. We could always make the additional option conditional at compile time, so you have to explicitly enable it in the build of CppUTest but, if the command-line parameter defaults to off anyway, I don't see it as being a big problem.
I'm happy to have a go at making the change, if you are happy with the proposal...
Thanks,
S.