Kaydet (Commit) 73780435 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

unottest: add get(URL|Path)FromWorkdir to locate $WORKDIR_FOR_BUILD

Change-Id: Iec4e609e023262f357a7552b75863aeae9385205
üst b68a0f65
......@@ -57,6 +57,8 @@ protected:
::rtl::OUString m_aSrcRootPath;
::rtl::OUString m_aSolverRootURL;
::rtl::OUString m_aSolverRootPath;
::rtl::OUString m_aWorkdirRootURL;
::rtl::OUString m_aWorkdirRootPath;
com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> m_xContext;
com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> m_xSFactory;
......@@ -80,6 +82,12 @@ public:
// return a Path to a given c-str path from the source directory
::rtl::OUString getPathFromSrc( const char *pPath );
// return a URL to a given c-str path from the workdir directory
::rtl::OUString getURLFromWorkdir( const char *pPath );
// return a Path to a given c-str path from the workdir directory
::rtl::OUString getPathFromWorkdir( const char *pPath );
virtual void setUp();
virtual void tearDown();
......
......@@ -50,21 +50,36 @@ test::BootstrapFixtureBase::BootstrapFixtureBase()
CPPUNIT_ASSERT_MESSAGE("SRC_ROOT env variable not set", pSrcRoot != NULL && pSrcRoot[0] != 0);
const char* pSolverRoot = getenv( "OUTDIR_FOR_BUILD" );
CPPUNIT_ASSERT_MESSAGE("$OUTDIR_FOR_BUILD env variable not set", pSolverRoot != NULL && pSolverRoot[0] != 0);
const char* pWorkdirRoot = getenv( "WORKDIR_FOR_BUILD" );
CPPUNIT_ASSERT_MESSAGE("$WORKDIR_FOR_BUILD env variable not set", pWorkdirRoot != NULL && pWorkdirRoot[0] != 0);
#ifdef WNT
if (pSrcRoot[1] == ':')
{
m_aSrcRootURL += rtl::OUString::createFromAscii( "/" );
}
if (pSolverRoot[1] == ':')
{
m_aSolverRootURL += rtl::OUString::createFromAscii( "/" );
}
if (pWorkdirRoot[1] == ':')
{
m_aWorkdirRootURL += rtl::OUString::createFromAscii( "/" );
}
#endif
#else
const char* pSrcRoot = "/assets";
const char* pSolverRoot = "/assets";
const char* pWorkdirRoot = "/assets";
#endif
m_aSrcRootPath = rtl::OUString::createFromAscii( pSrcRoot );
m_aSrcRootURL += m_aSrcRootPath;
m_aSolverRootPath = rtl::OUString::createFromAscii( pSolverRoot );
m_aSolverRootURL += m_aSolverRootPath;
m_aWorkdirRootPath = rtl::OUString::createFromAscii( pWorkdirRoot );
m_aWorkdirRootURL += m_aWorkdirRootPath;
}
test::BootstrapFixtureBase::~BootstrapFixtureBase()
......@@ -81,6 +96,18 @@ test::BootstrapFixtureBase::~BootstrapFixtureBase()
return m_aSrcRootPath + rtl::OUString::createFromAscii( pPath );
}
::rtl::OUString test::BootstrapFixtureBase::getURLFromWorkdir( const char *pPath )
{
return m_aWorkdirRootURL + rtl::OUString::createFromAscii( pPath );
}
::rtl::OUString test::BootstrapFixtureBase::getPathFromWorkdir( const char *pPath )
{
return m_aWorkdirRootPath + rtl::OUString::createFromAscii( pPath );
}
void test::BootstrapFixtureBase::setUp()
{
// set UserInstallation to user profile dir in test/user-template
......
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