From c1b1a702f96adcb12eb1a58ebe6170a229033ad0 Mon Sep 17 00:00:00 2001 From: Gabriel Busnot Date: Wed, 25 Jan 2023 07:28:39 +0000 Subject: [PATCH] tests: Make the GTestException type accessible to unit tests Change-Id: I654589a3d90377657393d98e75c0697ba0e72c76 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67455 Reviewed-by: Bobby Bruce Reviewed-by: Jason Lowe-Power Tested-by: kokoro Maintainer: Jason Lowe-Power --- src/base/gtest/logging.hh | 8 ++++++++ src/base/gtest/logging_mock.cc | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/base/gtest/logging.hh b/src/base/gtest/logging.hh index 12d4e5afb4..1d5a39c6bb 100644 --- a/src/base/gtest/logging.hh +++ b/src/base/gtest/logging.hh @@ -32,6 +32,14 @@ namespace gem5 { +// This custom exception type will help prevent fatal exceptions from being +// caught by other code in gem5 and let them escape to the gtest framework. +// Unfortunately that results in a somewhat confusing message about an unknown +// exception being thrown after the panic/fatal message has been printed, but +// there will at least be some indication what went wrong. +struct GTestException +{}; + class GTestLogOutput : public std::ostringstream { private: diff --git a/src/base/gtest/logging_mock.cc b/src/base/gtest/logging_mock.cc index 101374eecc..07a20ea1ec 100644 --- a/src/base/gtest/logging_mock.cc +++ b/src/base/gtest/logging_mock.cc @@ -36,14 +36,6 @@ namespace gem5 namespace { -// This custom exception type will help prevent fatal exceptions from being -// caught by other code in gem5 and let them escape to the gtest framework. -// Unfortunately that results in a somewhat confusing message about an unknown -// exception being thrown after the panic/fatal message has been printed, but -// there will at least be some indication what went wrong. -struct GTestException -{}; - class GTestLogger : public Logger { public: