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 <cppunittester/protectorfactory.hxx>
14 #include <sal/types.h>
15 #include <sal/log.hxx>
16 #include <test/setupvcl.hxx>
17 #include <vcl/svapp.hxx>
18 #include <comphelper/threadpool.hxx>
20 #include "isheadless.hxx"
24 class Protector
: public CppUnit::Protector
{
26 Protector() { test::setUpVcl(); }
27 Protector(const Protector
&) = delete;
28 Protector
& operator=(const Protector
&) = delete;
31 virtual ~Protector() override
{
32 #if defined(__COVERITY__)
36 // for the 6 tests that use it
37 comphelper::ThreadPool::getSharedOptimalPool().shutdown();
38 #if defined(__COVERITY__)
39 } catch (const std::exception
& e
) {
40 SAL_WARN("vcl.app", "Fatal exception: " << e
.what());
47 CppUnit::Functor
const & functor
, CppUnit::ProtectorContext
const &)
54 extern "C" SAL_DLLPUBLIC_EXPORT
CppUnit::Protector
*
55 vclbootstrapprotector() {
59 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */