summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-06-04 08:45:54 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-06-04 08:55:12 +0200
commit369d95931f42267eb2f55e066f58ee859183025d (patch)
treef6047cebccb31dea56653bb1adfa08f853d09918 /test
parent9e13afeaf67b9c07762692cd858de4b577234ab7 (diff)
DeInitVCL at end of tests
This required some changes to the framework: * Init-/DeInitVCL is no longer done per individual test in BootstrapFixture, but once per CppunitTest invocation in a new vclbootstrapprotector (similarly to the exisiting unobootstrapprotector). CppunitTests that need VCL now need to declare gb_CppunitTest_use_vcl. * For things to work properly, the UNO component context needs to be disposed from within DeInitVCL (cf. Desktop's Application::DeInit called from DeInitVCL). The easiest solution was to introduce an Application::setDeInitHook (where the hook is called from DeInitVCL) specifically for vclbootstrapprotector to call. * PythonTests don't (yet) call DeInitVCL; they still hook into BootstrapFixture's original test_init functionality (to call InitVCL), and do not make use of the vclbootstrapprotector. Change-Id: I4f3a3c75db30b58c1cd49d81c51db14902ed68b2
Diffstat (limited to 'test')
-rw-r--r--test/Module_test.mk1
-rw-r--r--test/source/bootstrapfixture.cxx31
2 files changed, 17 insertions, 15 deletions
diff --git a/test/Module_test.mk b/test/Module_test.mk
index 905d66b52c6f..7482d280e94e 100644
--- a/test/Module_test.mk
+++ b/test/Module_test.mk
@@ -14,6 +14,7 @@ ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_targets,test,\
Library_test \
Library_subsequenttest \
+ Library_vclbootstrapprotector \
Package_unittest \
))
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index e8dcfa80c32e..110e0a53cf26 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -60,21 +60,6 @@ extern "C"
void test_init_impl(bool bAssertOnDialog, bool bNeedUCB,
lang::XMultiServiceFactory * pSFactory)
{
- // force locale (and resource files loaded) to en-US
- OUString aLangISO( "en-US" );
- ResMgr::SetDefaultLocale( LanguageTag( aLangISO) );
-
- SvtSysLocaleOptions aLocalOptions;
- aLocalOptions.SetLocaleConfigString( aLangISO );
- aLocalOptions.SetUILocaleConfigString( aLangISO );
-
- MsLangId::setConfiguredSystemUILanguage(LANGUAGE_ENGLISH_US);
- LanguageTag::setConfiguredSystemLanguage(LANGUAGE_ENGLISH_US);
-
- InitVCL();
- if (Application::IsHeadlessModeRequested())
- Application::EnableHeadlessMode(true);
-
if (bAssertOnDialog)
ErrorHandler::RegisterDisplay( aBasicErrorFunc );
@@ -102,6 +87,22 @@ SAL_DLLPUBLIC_EXPORT void test_init(lang::XMultiServiceFactory *pFactory)
try
{
::comphelper::setProcessServiceFactory(pFactory);
+
+ // force locale (and resource files loaded) to en-US
+ OUString aLangISO( "en-US" );
+ ResMgr::SetDefaultLocale( LanguageTag( aLangISO) );
+
+ SvtSysLocaleOptions aLocalOptions;
+ aLocalOptions.SetLocaleConfigString( aLangISO );
+ aLocalOptions.SetUILocaleConfigString( aLangISO );
+
+ MsLangId::setConfiguredSystemUILanguage(LANGUAGE_ENGLISH_US);
+ LanguageTag::setConfiguredSystemLanguage(LANGUAGE_ENGLISH_US);
+
+ InitVCL();
+ if (Application::IsHeadlessModeRequested())
+ Application::EnableHeadlessMode(true);
+
test_init_impl(false, true, pFactory);
}
catch (...) { abort(); }