Kaydet (Commit) 013efe75 authored tarafından Michael Stahl's avatar Michael Stahl

test: hack to avoid VCLXToolkit calling CreateMainLoopThread

... for the PythonTest, similar to what vclbootstrapprotector does for
CppunitTest; actually no idea if this is a good idea or a bad idea.

Change-Id: Ia4e2e50fdc9c8deb9faf580a2f3f3308533265eb
Reviewed-on: https://gerrit.libreoffice.org/17540Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst f0e90c71
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <i18nlangtag/mslangid.hxx> #include <i18nlangtag/mslangid.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <tools/resmgr.hxx> #include <tools/resmgr.hxx>
#include <tools/link.hxx>
#include <vcl/graphicfilter.hxx> #include <vcl/graphicfilter.hxx>
#include <unotools/syslocaleoptions.hxx> #include <unotools/syslocaleoptions.hxx>
#include <osl/file.hxx> #include <osl/file.hxx>
...@@ -83,6 +84,15 @@ void test_init_impl(bool bAssertOnDialog, bool bNeedUCB, ...@@ -83,6 +84,15 @@ void test_init_impl(bool bAssertOnDialog, bool bNeedUCB,
} }
} }
struct InitHook {
DECL_STATIC_LINK(InitHook, deinitHook, void*);
};
IMPL_STATIC_LINK_NOARG(InitHook, deinitHook) {
// nothing to do for now
return 0;
}
// this is called from pyuno // this is called from pyuno
SAL_DLLPUBLIC_EXPORT void test_init(lang::XMultiServiceFactory *pFactory) SAL_DLLPUBLIC_EXPORT void test_init(lang::XMultiServiceFactory *pFactory)
{ {
...@@ -105,6 +115,9 @@ SAL_DLLPUBLIC_EXPORT void test_init(lang::XMultiServiceFactory *pFactory) ...@@ -105,6 +115,9 @@ SAL_DLLPUBLIC_EXPORT void test_init(lang::XMultiServiceFactory *pFactory)
if (test::isHeadless()) if (test::isHeadless())
Application::EnableHeadlessMode(true); Application::EnableHeadlessMode(true);
// avoid VCLXToolkit thinking that InitVCL hasn't been called
Application::setDeInitHook(LINK(nullptr, InitHook, deinitHook));
test_init_impl(false, true, pFactory); test_init_impl(false, true, pFactory);
} }
catch (...) { abort(); } catch (...) { abort(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment