1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <sal/config.h>
12 #include <cppunit/Protector.h>
13 #include <sal/types.h>
14 #include <sal/log.hxx>
15 #include <vcl/svapp.hxx>
16 #include <comphelper/threadpool.hxx>
17 #include "setupvcl.hxx"
21 class Protector
: public CppUnit::Protector
{
23 Protector() { test::setUpVcl(); }
24 Protector(const Protector
&) = delete;
25 Protector
& operator=(const Protector
&) = delete;
28 virtual ~Protector() override
{
29 #if defined(__COVERITY__) && __COVERITY_MAJOR__ <= 2023
33 // for the 6 tests that use it
34 comphelper::ThreadPool::getSharedOptimalPool().shutdown();
35 #if defined(__COVERITY__) && __COVERITY_MAJOR__ <= 2023
36 } catch (const std::exception
& e
) {
37 SAL_WARN("vcl.app", "Fatal exception: " << e
.what());
44 CppUnit::Functor
const & functor
, CppUnit::ProtectorContext
const &)
51 extern "C" SAL_DLLPUBLIC_EXPORT
CppUnit::Protector
*
52 vclbootstrapprotector() {
56 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */