diff options
author | Thorsten Behrens <tbehrens@novell.com> | 2011-04-22 15:57:41 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2011-04-22 15:57:41 +0200 |
commit | ff5662e330da54c31760d7edbc27b98132b0926c (patch) | |
tree | b3003838ba0b5fe59f3a4b5d1dc15e03b253d47b | |
parent | 0be571d9a673ab48fc7d3a94541c5720e0845016 (diff) |
testtool-more-defaults.diff: make testtool work out-of-the-box
tweaked existing defaults such that running testtool from inside a dev install
works out-of-the-box. Additionally passing SRC_ROOT from build env to testtool
-rw-r--r-- | automation/source/testtool/objtest.cxx | 62 | ||||
-rw-r--r-- | automation/source/testtool/testtool.ini | 1 |
2 files changed, 62 insertions, 1 deletions
diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx index 7569c69f3be3..e08dd7c5faeb 100644 --- a/automation/source/testtool/objtest.cxx +++ b/automation/source/testtool/objtest.cxx @@ -479,6 +479,68 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die d GetHostConfig(); GetTTPortConfig(); GetUnoPortConfig(); + + aConf.SetGroup("Crashreporter"); + + String aUP; + GETSET( aUP, "UseProxy", "false" ); + String aPS; + GETSET( aPS, "ProxyServer", "" ); + String aPP; + GETSET( aPP, "ProxyPort", "" ); + String aAC; + GETSET( aAC, "AllowContact", "false" ); + String aRA; + GETSET( aRA, "ReturnAddress", "" ); + + OUString sPath; + if( osl_getExecutableFile( (rtl_uString**)&sPath ) == osl_Process_E_None) + { + sPath = sPath.copy(7); // strip file:// + + int i = sPath.lastIndexOf('/'); + if (i >= 0) + i = sPath.lastIndexOf('/', i-1 ); + + if (i >= 0) + { + sPath = sPath.copy(0, i); + ByteString bsPath( sPath.getStr(), sPath.getLength(), + RTL_TEXTENCODING_UTF8 ); + + aConf.SetGroup( "OOoProgramDir" ); + String aOPD; + // testtool is installed in Basis3.x/program/ dir nowadays + bsPath += "/../program"; + GETSET( aOPD, "Current", bsPath); + + ByteString aSrcRoot(getenv("SRC_ROOT")); + aConf.SetGroup( "_profile_Default" ); + if (aSrcRoot.Len()) + { + String aPBD; + aSrcRoot += "/testautomation"; + GETSET( aPBD, "BaseDir", aSrcRoot ); + + String aPHD; + aSrcRoot += "/global/hid"; + GETSET( aPHD, "HIDDir", aSrcRoot ); + } + else + { + String aPBD; + bsPath += "/qatesttool"; + GETSET( aPBD, "BaseDir", bsPath ); + + String aPHD; + bsPath += "/global/hid"; + GETSET( aPHD, "HIDDir", bsPath ); + } + + String aLD; + GETSET( aLD, "LogBaseDir", ByteString( "/tmp" ) ); + } + } } #define MAKE_TT_KEYWORD( cName, aType, aResultType, nID ) \ diff --git a/automation/source/testtool/testtool.ini b/automation/source/testtool/testtool.ini index ff2e43f5c0f6..7b77654eed58 100644 --- a/automation/source/testtool/testtool.ini +++ b/automation/source/testtool/testtool.ini @@ -9,7 +9,6 @@ CurrentProfile=_profile_Default [OOoProgramDir] Type=Path -Current=. [Crashreporter] UseProxy=false |