summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-09-29 18:30:06 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-09-29 18:35:16 +0200
commit3581e9df565df6cb67992c25e47ff37fd85030b3 (patch)
tree43f32f2998c3674a84fbab3973280b5e420ae2fc /test
parentb94aa65357bb7c9e7da8ef3b4dc4ed98ab70ec2f (diff)
init the unit test for vba unit tests correctly
Diffstat (limited to 'test')
-rw-r--r--test/source/bootstrapfixture.cxx26
1 files changed, 16 insertions, 10 deletions
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index 358036f2127a..0d0234e0346e 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -29,6 +29,7 @@
#include <test/bootstrapfixture.hxx>
#include <tools/errinf.hxx>
#include <rtl/strbuf.hxx>
+#include <rtl/bootstrap.hxx>
#include <cppuhelper/bootstrap.hxx>
#include <ucbhelper/contentbroker.hxx>
#include <comphelper/processfactory.hxx>
@@ -56,6 +57,21 @@ static void aBasicErrorFunc( const String &rErr, const String &rAction )
test::BootstrapFixture::BootstrapFixture( bool bAssertOnDialog )
: m_aSrcRootURL(RTL_CONSTASCII_USTRINGPARAM("file://"))
{
+ const char* pSrcRoot = getenv( "SRC_ROOT" );
+ CPPUNIT_ASSERT_MESSAGE("SRC_ROOT env variable not set", pSrcRoot != NULL && pSrcRoot[0] != 0);
+
+#ifdef WNT
+ if (pSrcRoot[1] == ':')
+ m_aSrcRootURL += rtl::OUString::createFromAscii( "/" );
+#endif
+ m_aSrcRootPath = rtl::OUString::createFromAscii( pSrcRoot );
+ m_aSrcRootURL += m_aSrcRootPath;
+
+ //set UserInstallation to user profile dir in test/user-template
+ rtl::Bootstrap aDefaultVars;
+ aDefaultVars.set( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UserInstallation") ),
+ getURLFromSrc("/test/user-template"));
+
m_xContext = cppu::defaultBootstrap_InitialComponentContext();
m_xFactory = m_xContext->getServiceManager();
m_xSFactory = uno::Reference<lang::XMultiServiceFactory> (m_xFactory, uno::UNO_QUERY_THROW);
@@ -94,16 +110,6 @@ test::BootstrapFixture::BootstrapFixture( bool bAssertOnDialog )
if( bAssertOnDialog )
ErrorHandler::RegisterDisplay( aBasicErrorFunc );
-
- const char* pSrcRoot = getenv( "SRC_ROOT" );
- CPPUNIT_ASSERT_MESSAGE("SRC_ROOT env variable not set", pSrcRoot != NULL && pSrcRoot[0] != 0);
-
-#ifdef WNT
- if (pSrcRoot[1] == ':')
- m_aSrcRootURL += rtl::OUString::createFromAscii( "/" );
-#endif
- m_aSrcRootPath = rtl::OUString::createFromAscii( pSrcRoot );
- m_aSrcRootURL += m_aSrcRootPath;
}
test::BootstrapFixture::~BootstrapFixture()