summaryrefslogtreecommitdiff
path: root/unotest
diff options
context:
space:
mode:
Diffstat (limited to 'unotest')
-rw-r--r--unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx b/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx
index 7a5b17b750c9..764f49d79bf5 100644
--- a/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx
+++ b/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <cstdlib>
#include <string>
#include <string_view>
@@ -75,7 +76,7 @@ bool Prot::protect(
extern "C" SAL_DLLPUBLIC_EXPORT CppUnit::Protector *
unoexceptionprotector() {
- return new Prot;
+ return std::getenv("CPPUNIT_PROPAGATE_EXCEPTIONS") == nullptr ? new Prot : nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */