Skip to content

unreal engine support & noreturn/std::abort #327

@akhosravian

Description

@akhosravian

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:

  1. define TROMPELOEIL_NORETURN to nothing
  2. removed the call to std::abort in report_mismatch
  3. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions