boostorg / boostorg/test

Report the exception text from BOOST_CHECK_NO_THROW

Open
#423 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
213
Forks
149
Avg merge
18h 17m
Merged PRs (30d)
2

Description

Source: https://stackoverflow.com/questions/15133259/boost-check-no-throw-how-to-get-exception-message-printed

When I test a method using

```cpp
BOOST_CHECK_NO_THROW( method_to_test() );
```

and an exception is thrown, it displays that an exception was thrown, but never the exception's message like this:

```
test.cpp(14): error in "test": incorrect exception my_exception is caught
```

Is it possible to print the exception message as well, i.e. the string returned by `my_exception.what()`? `my_exception` is derived from `std::exception` and overloads `what()`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.