From a55cc075483dc1bc05193cdd28eda6e1e6e21a5a Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 6 Mar 2020 12:08:43 +0000 Subject: [PATCH] ts(gtest): dump exception message from EXPECT_NO_THROW() --- modules/ts/include/opencv2/ts/ts_gtest.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ts/include/opencv2/ts/ts_gtest.h b/modules/ts/include/opencv2/ts/ts_gtest.h index 0cffe61fea..bf0ff9134e 100644 --- a/modules/ts/include/opencv2/ts/ts_gtest.h +++ b/modules/ts/include/opencv2/ts/ts_gtest.h @@ -9235,6 +9235,10 @@ class NativeArray { try { \ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ } \ + catch (const std::exception& e) { \ + std::cerr << "Exception message: " << e.what() << std::endl; \ + goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \ + } \ catch (...) { \ goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \ } \