From fb578d5178c12f6a9e7a3ae947c9d20803963c05 Mon Sep 17 00:00:00 2001 From: Colin Graf Date: Fri, 18 Oct 2019 15:18:21 +0200 Subject: [PATCH] Improved error messages for uncaught std::exception --- src/gtest/gtest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gtest/gtest.cpp b/src/gtest/gtest.cpp index 277f34f..3122f81 100644 --- a/src/gtest/gtest.cpp +++ b/src/gtest/gtest.cpp @@ -324,6 +324,11 @@ int run(const char* filter, const char* outputFile_) ; } } + catch (const std::exception& e) + { + std::string message = std::string("uncaught std::exception: ") + e.what(); + fail(testData.test->file, testData.test->line, message.c_str()); + } catch (...) { fail(testData.test->file, testData.test->line, "uncaught exception");