[Libreoffice-commits] .: Branch 'libreoffice-3-4' - automation/source

Petr Mladek pmladek at kemper.freedesktop.org
Fri Apr 22 06:59:25 PDT 2011


 automation/source/testtool/objtest.cxx  |   62 ++++++++++++++++++++++++++++++++
 automation/source/testtool/testtool.ini |    1 
 2 files changed, 62 insertions(+), 1 deletion(-)

New commits:
commit 8e784936338edeaf20f48c93d5b87bfbf23c5472
Author: Thorsten Behrens <tbehrens at novell.com>
Date:   Fri Apr 22 15:57:41 2011 +0200

    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

diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx
index 94866c5..7c05142 100644
--- a/automation/source/testtool/objtest.cxx
+++ b/automation/source/testtool/objtest.cxx
@@ -479,6 +479,68 @@ void TestToolObj::LoadIniFile()				// Laden der IniEinstellungen, die durch den
     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 ff2e43f..7b77654 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


More information about the Libreoffice-commits mailing list