Skip to content

Let EXPECT print the error message before throwing an exception #70

@martinmoene

Description

@martinmoene

Detlef Vollmann brings up the following:

I'm using lest for test cases for the exercises of a C++ course. My problem is that sometimes I EXPECT some invariant of an object, and if that's failing, it's not safe to call the destructor.

However, EXPECT throws an exception before it prints its message, so effectively I get a crash by the destructor of the local test object and never see the message from the failed test, which is not very useful.

Preferably I'd like to avoid the crash completely (by calling exit() or terminate() myself), but the minimum would be to at least see the message before the crash.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions