| 157 | } |
| 158 | |
| 159 | BOOST_NOINLINE BOOST_SYMBOL_VISIBLE void test_from_other_thread() { |
| 160 | |
| 161 | // MinGW error: 'thread' is not a member of 'std' |
| 162 | #ifndef __MINGW32__ |
| 163 | std::exception_ptr ptr; |
| 164 | |
| 165 | std::thread t([&ptr]{ |
| 166 | try { |
| 167 | in_test_throw_1("test_other_exception_active"); |
| 168 | } catch (const std::exception&) { |
| 169 | try { |
| 170 | in_test_throw_2("test_other_exception_active 2"); |
| 171 | } catch (const std::exception&) { |
| 172 | ptr = std::current_exception(); |
| 173 | } |
| 174 | } |
| 175 | }); |
| 176 | t.join(); |
| 177 | |
| 178 | try { |
| 179 | std::rethrow_exception(ptr); |
| 180 | } catch (...) { |
| 181 | auto trace = stacktrace::from_current_exception(); |
| 182 | BOOST_TEST(trace); |
| 183 | std::cout << "Tarce in test_rethrow_nested(): " << trace << '\n'; |
| 184 | BOOST_TEST(to_string(trace).find("in_test_throw_1") == std::string::npos); |
| 185 | #if defined(BOOST_MSVC) |
| 186 | BOOST_TEST(to_string(trace).find("in_test_throw_2") == std::string::npos); |
| 187 | #else |
| 188 | BOOST_TEST(to_string(trace).find("in_test_throw_2") != std::string::npos); |
| 189 | #endif |
| 190 | } |
| 191 | #endif |
| 192 | } |
| 193 | |
| 194 | int main() { |
| 195 | const test_no_pending_on_finish guard{}; |
no test coverage detected