Hi!
I'm trying to use trompeloeil with Unreal Engine. I was able to get it up and running using the steps in the manual to create either a compile or run time adapter; however, Unreal's tests run inside a longer lived process and that means trompeloeil's out of the box behavior for invalid mock calls (aborting the test process) is inappropriate.
I sidestepped this using a custom #define before including trompeloeil.hpp that does a few things:
- define
TROMPELOEIL_NORETURN to nothing
- removed the call to
std::abort in report_mismatch
- return at the end of the
if(!i) block in mock_func.
There are other spots where std::abort appears, but this was enough to get basic failures playing well with Unreal's tests. Any obvious land mines with this approach? Is this something you'd be interested in seeing a PR for?
Hi!
I'm trying to use trompeloeil with Unreal Engine. I was able to get it up and running using the steps in the manual to create either a compile or run time adapter; however, Unreal's tests run inside a longer lived process and that means trompeloeil's out of the box behavior for invalid mock calls (aborting the test process) is inappropriate.
I sidestepped this using a custom #define before including trompeloeil.hpp that does a few things:
TROMPELOEIL_NORETURNto nothingstd::abortinreport_mismatchif(!i)block inmock_func.There are other spots where std::abort appears, but this was enough to get basic failures playing well with Unreal's tests. Any obvious land mines with this approach? Is this something you'd be interested in seeing a PR for?