summaryrefslogtreecommitdiff
path: root/smoketestoo_native
diff options
context:
space:
mode:
Diffstat (limited to 'smoketestoo_native')
-rwxr-xr-xsmoketestoo_native/config.pl83
-rwxr-xr-xsmoketestoo_native/data/TestExtension.oxtbin4210 -> 0 bytes
-rw-r--r--smoketestoo_native/data/dbgsv.ini42
-rwxr-xr-xsmoketestoo_native/data/scripts/Global.xba739
-rwxr-xr-xsmoketestoo_native/data/scripts/Test_10er.xba907
-rwxr-xr-xsmoketestoo_native/data/scripts/Test_DB.xba135
-rwxr-xr-xsmoketestoo_native/data/scripts/Test_Ext.xba95
-rwxr-xr-xsmoketestoo_native/data/scripts/script.xlb8
-rwxr-xr-xsmoketestoo_native/data/smoketestdoc.sxwbin35157 -> 35384 bytes
-rw-r--r--smoketestoo_native/data/solaris/sparc/admin6
-rwxr-xr-xsmoketestoo_native/data/solaris/sparc/getuid.sobin4108 -> 0 bytes
-rw-r--r--smoketestoo_native/data/solaris/x86/admin6
-rwxr-xr-xsmoketestoo_native/data/solaris/x86/getuid.sobin3796 -> 0 bytes
-rw-r--r--smoketestoo_native/makefile.mk60
-rw-r--r--smoketestoo_native/prj/build.lst2
-rw-r--r--smoketestoo_native/smoketest.cxx169
-rwxr-xr-xsmoketestoo_native/smoketest.pl1279
-rwxr-xr-xsmoketestoo_native/testlog.pl286
-rw-r--r--[-rwxr-xr-x]smoketestoo_native/version.map (renamed from smoketestoo_native/check_setup.pl)49
19 files changed, 214 insertions, 3652 deletions
diff --git a/smoketestoo_native/config.pl b/smoketestoo_native/config.pl
deleted file mode 100755
index 988d1176ed42..000000000000
--- a/smoketestoo_native/config.pl
+++ /dev/null
@@ -1,83 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-use File::Path;
-
-$branddir = $ARGV[0];
-$userinstalldir = $ARGV[1];
-$buildid = $ARGV[2];
-
-if ($ENV{GUI} ne "UNX") {
- $quickstart = $branddir . "program/quickstart.exe";
- print "kill $quickstart\n";
- unlink $quickstart or die "cannot unlink $fullquickstart_path";
-}
-
-$regpath = $userinstalldir . "user";
-$regfile = $regpath . "/registrymodifications.xcu";
-print "create $regfile\n";
-mkpath($regpath, 0, 0777);
-open (OUT, "> $regfile") or die "cannot open $regfile for writing";
-print OUT << "EOF";
-<oor:items xmlns:oor='http://openoffice.org/2001/registry'>
- <item oor:path='/org.openoffice.Office.Common/Help/Registration'>
- <prop oor:name='ReminderDate'>
- <value>Patch$buildid</value>
- </prop>
- </item>
- <item oor:path='/org.openoffice.Office.Common/Misc'>
- <prop oor:name='FirstRun'>
- <value>false</value>
- </prop>
- </item>
- <item oor:path='/org.openoffice.Office.Common/Security/Scripting'>
- <prop oor:name='MacroSecurityLevel'>
- <value>0</value>
- </prop>
- <prop oor:name='OfficeBasic'>
- <value>2</value>
- </prop>
- </item>
- <item oor:path='/org.openoffice.Office.OOoImprovement.Settings/Participation'>
- <prop oor:name='InvitationAccepted'>
- <value>false</value>
- </prop>
- <prop oor:name='ShowedInvitation'>
- <value>true</value>
- </prop>
- </item>
- <item oor:path='/org.openoffice.Setup/Office'>
- <prop oor:name='FirstStartWizardCompleted'>
- <value>true</value>
- </prop>
- <prop oor:name='LicenseAcceptDate'>
- <value>2100-01-01T00:00:00</value>
- </prop>
- </item>
-</oor:items>
-EOF
-close OUT;
diff --git a/smoketestoo_native/data/TestExtension.oxt b/smoketestoo_native/data/TestExtension.oxt
deleted file mode 100755
index 70580b6a52e3..000000000000
--- a/smoketestoo_native/data/TestExtension.oxt
+++ /dev/null
Binary files differ
diff --git a/smoketestoo_native/data/dbgsv.ini b/smoketestoo_native/data/dbgsv.ini
deleted file mode 100644
index 42142b4124e5..000000000000
--- a/smoketestoo_native/data/dbgsv.ini
+++ /dev/null
@@ -1,42 +0,0 @@
-[output]
-log_file=dbgsv.log
-overwrite=1
-include=
-exclude=
-include_class=
-exclude_class=
-trace=dev/null
-warning=dev/null
-error=window
-
-[memory]
-initialize=1
-overwrite=0
-overwrite_free=0
-pointer=0
-report=0
-trace=0
-new_and_delete=0
-object_test=0
-sys_alloc=0
-leak_report=0
-
-init_byte=77
-bound_byte=55
-free_byte=33
-
-[gui]
-debug_window_state=
-
-[objects]
-check_this=0
-check_function=0
-check_exit=0
-generate_report=0
-trace=0
-
-[test]
-profiling=0
-resources=1
-dialog=0
-bold_app_font=0
diff --git a/smoketestoo_native/data/scripts/Global.xba b/smoketestoo_native/data/scripts/Global.xba
deleted file mode 100755
index c56b444cf030..000000000000
--- a/smoketestoo_native/data/scripts/Global.xba
+++ /dev/null
@@ -1,739 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
-<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Global" script:language="StarBasic">REM ***** BASIC *****
-
-const cMaxErrorStates = 13
-
-const cCoGreen = 4057917, cCoRed = 16711680, cCoGrey = 12632256
-const cParagraphBreak = 0
-
-global const cExtensionFileName = &quot;TestExtension.oxt&quot;
-
-global const cDocNew = 0, cDocCut = 1, cDocPaste = 2, cDocSaveOpen8 = 3, cDocSaveOpenXML = 4, cDocSaveOpen50 = 5, cDocClose = 6, cDocWrite = 7
-global const cNewsInit = 0, cNewsSend = 1, cNewsRead = 2
-global const cDBService = 0, cDBOpen = 1, cDBInsert = 2, cDBDelete = 3, cDBSeek = 4, cDBClose = 5
-global const cEXTService = 0, cEXTInstall = 1, cEXTUninstall = 2
-global const cScheduleDateRead = 0
-global const cLogfileFailed = 255
-
-global const cStWriter = 0, cStCalc = 1, cStPraesentation = 2, cStZeichnen = 3
-global const cStMessage = 12, cStHTML = 6, cStChart = 4, cStJava = 7
-global const cStMath = 5, cStNews = 10, cStSchedule = 8, cStDataBase = 9
-global const cStExtension = 11
-global const cStNone = -1
-
-global const cFlt8 = 0, cFlt50 = 32, cFltNewDoc = 64, cFltXML = 128
-
-global const frmWriter = 1, frmCalc = 2, frmMessage = 3, frmImpress = 4
-global const frmMath = 5, frmImage = 6, frmChart = 7, frmHyperText = 8, frmDraw = 9
-global const frmDataBase = 10, frmSchedule = 11, frmNews = 12, frmJava = 13
-global const frmExtension = 14
-
-global const cLogUnknown = 0, cLogFalse = 1, cLogTrue = 2
-
-&apos;UserFieldKennungen
-Global const cYes = &quot;y&quot;, cNo = &quot;n&quot;
-Global const cStateNo = 0, cStateYes = 1
-
-&apos;Feldtypen
-Global const cFtExtUser = 21, cFtPageNum = 5, cFtStatistic = 8, cFtDateTime = 27, cFtDatabase = 31
-
-&apos;UnoStrings
-Global const cUnoSeparator = &quot;.&quot;
-Global const cUnoPrefix = &quot;com.sun.star.&quot;
-Global const cUnoUserField = cUnoPrefix + &quot;text.FieldMaster.User&quot;
-Global const cUnoExtUserField = cUnoPrefix + &quot;text.TextField.ExtendedUser&quot;
-Global const cUnoMasterDataBase = cUnoPrefix + &quot;text.FieldMaster.Database&quot;
-Global const cUnoDataBase = cUnoPrefix + &quot;text.TextField.Database&quot;
-Global const cUnoDateTime = cUnoPrefix + &quot;text.TextField.DateTime&quot;
-Global const cUnoTextGraphi2 = cUnoPrefix + &quot;text.Graphic&quot;
-Global const cUnoJavaLoader = cUnoPrefix + &quot;loader.Java&quot;
-Global const cUnoDatabaseContext = cUnoPrefix + &quot;sdb.DatabaseContext&quot;
-Global const cUnoRowSet = cUnoPrefix + &quot;sdb.RowSet&quot;
-Global const cUnoSmoketestTestExtension = cUnoPrefix + &quot;comp.smoketest.TestExtension&quot;
-Global const cUnoSmoketestCommandEnvironment = cUnoPrefix + &quot;deployment.test.SmoketestCommandEnvironment&quot;
-Global const cUnothePackageManagerFactory = cUnoPrefix + &quot;deployment.thePackageManagerFactory&quot;
-
-&apos;UserFieldNames
-Global const cUserFieldTestWriter = &quot;Writer&quot;, cUserFieldTestCalc = &quot;Calc&quot;, cUserFieldTestImpress = &quot;Impress&quot;
-Global const cUserFieldTestDraw = &quot;Draw&quot;, cUserFieldTestMath = &quot;Math&quot;, cUserFieldTestChart = &quot;Chart&quot;
-Global const cUserFieldTestHTML = &quot;HTML&quot;, cUserFieldTestJava = &quot;Java&quot;, cUserFieldTestDatabase = &quot;Database&quot;
-Global const cUserFieldTestExtension = &quot;Extension&quot;
-Global const cUserFieldTestOpenSaveXML = &quot;SaveOpenXML&quot;, cUserFieldTestOpenSave50 = &quot;SaveOpen50&quot;, cUserFieldTestCut = &quot;Cut&quot;
-Global const cUserFieldTestPaste = &quot;Paste&quot;, cUserFieldTestTerminateAfterTest = &quot;Terminate&quot;, cUserFieldTestOpenSave8 = &quot;SaveOpen8&quot;
-
-Global const cOptionsDialogName = &quot;OptionsDlg&quot;, cTest10Modul = &quot;Standard&quot;
-
-Global const cDlgCancel = 1, cDlgOk = 0, cDlgStartTest = 2
-
-global gErrorState (cMaxErrorStates, 5) as integer
-
-global gOutputDoc as Object
-global gOutputDocNotUno as Object
-global gOptionsDialog as Object
-Dim bMakeMailAccount as Boolean, bTestMail as Boolean, bTestDocs as Boolean
-Dim bTestSchedule as Boolean, bTestAdr as Boolean
-
-Global bMakeWriterTest as boolean, bMakeCalcTest as boolean, bMakeImpressTest as boolean
-Global bMakeDrawTest as Boolean, bMakeMathTest as boolean, bMakeChartTest as boolean
-Global bMakeHTMLTest as boolean, bMakeJavaTest as boolean, bMakeDBTest as boolean
-Global bMakeExtensionTest as boolean
-Global bMakeSaveOpenXMLTest as boolean, bMakeSaveOpen50Test as boolean, bMakeCutTest as boolean
-Global bMakePasteTest as boolean, bMakeTerminateAfterTest as boolean, bShowTable as boolean
-Global bMakeSaveOpen8Test as boolean
-
-global sExtensionURL as string
-
-Dim gDlgState as Integer
-
-Sub SetGlobalDoc
- gOutPutDoc = StarDesktop.CurrentComponent
-end Sub
-
-Sub ClearStatus
- for j% = 0 to cMaxErrorStates
- for i% = 0 to 5
- gErrorState (j%, i%) = cLogUnknown
- next i%
- next j%
-end Sub
-
-Sub ClearAllText
- call SetGlobalDoc
- call ClearDoc (gOutPutDoc)
- call ClearStatus
-end Sub
-
-Sub Main
- call SetGlobalDoc
- if bShowTable then
- call ClearDoc (gOutPutDoc)
- end If
-
- call ClearStatus
-
- Call Test_10er.Main
-
- if bShowTable then
- call CreateStatusTable2
- call CreateStatusTable
- call CreateDocState
- call CreateSecondState
- gOutputDoc.CurrentController.ViewCursor.JumpToFirstPage
- end if
-End Sub
-
-Sub CreateStatusTable
- dim tableHeaders(7) as string
- tableHeaders(cStWriter) = &quot;Writer&quot;
- tableHeaders(cStCalc) = &quot;Calc&quot;
- tableHeaders(cStPraesentation) = &quot;PrÃĪsen- tation&quot;
- tableHeaders(cStZeichnen) = &quot;Zeichn.&quot;
- tableHeaders(cStChart) = &quot;Diagr.&quot;
- tableHeaders(cStMath) = &quot;Math&quot;
- tableHeaders(cStHTML) = &quot;HTML&quot;
- tableHeaders(cStJava) = &quot;Java&quot;
-
- dim tableColums(5) as string
- tableColums(cDocNew) = &quot;new&quot;
- tableColums(cDocCut) = &quot;cut&quot;
- tableColums(cDocPaste) = &quot;paste&quot;
- tableColums(cDocSaveOpen8) = &quot;V8.0&quot;
- tableColums(cDocSaveOpenXML) = &quot;XML&quot;
- tableColums(cDocSaveOpen50) = &quot;V5.0&quot;
-&apos; tableColums(cDocClose) = &quot;close&quot;
-
- aDoc = gOutPutDoc
-
- xText = aDoc.Text
- xCursor = xText.createTextCursor()
-
-&apos; xCursor.gotoStart(FALSE)
-&apos; xCursor.GoRight (2, False)
-&apos; SetParagraphBreak (xCursor)
-&apos; SetParagraphBreak (xCursor)
- xCursor.gotoStart(FALSE)
- xCursor.GoRight (4, False)
- SetParagraphBreak (xCursor)
- xCursor.GoRight (1, False)
- SetParagraphBreak (xCursor)
- xCursor.GoRight (1, False)
-
- table = aDoc.createInstance(&quot;com.sun.star.text.TextTable&quot;)
- table.initialize(7,9)
- table.Name = &quot;StTab1&quot;
- xText.insertTextContent(xCursor, table, FALSE)
-
- tableCursor = table.createCursorByCellName(table.CellNames(0))
- tableCursor.gotoStart(FALSE)
- tableCursor.goRight(1,FALSE)
-
- for i% = 0 to 7
- cName = tableCursor.getRangeName()
- xCell = table.getCellByName(cName)
- xCell.String=tableHeaders(i%)
-
- xCell.BackTransparent = False
- xCell.BackColor = cCoGrey
-
- tableCursor.goRight(1,FALSE)
- next i%
-
- xCursor.gotoStart(FALSE)
-&apos; SetParagraphBreak (xCursor)
-&apos; SetParagraphBreak (xCursor)
-
- tableCursor.gotoStart(FALSE)
- cName = tableCursor.getRangeName()
- xCell = table.getCellByName(cName)
- xCell.BackTransparent = False
- xCell.BackColor = cCoGrey
-
- for i% = 0 to 5
- tableCursor.goDown(1,FALSE)
- cName = tableCursor.getRangeName()
- xCell = table.getCellByName(cName)
- xCell.String=tableColums(i%)
-
- xCell.BackTransparent = False
- xCell.BackColor = cCoGrey
- next i%
-end Sub
-
-Sub CreateStatusTable2
- dim tableHeaders(5) as string
- tableHeaders(cStDataBase-9) = &quot;Database&quot;
- tableHeaders(1) = &quot;&quot;
- tableHeaders(cStExtension-9) = &quot;Extension&quot;
- tableHeaders(3) = &quot;&quot;
- tableHeaders(4) = &quot;&quot;
-
- dim tableColums(5) as string
- tableColums(cDBService ) = &quot;services&quot;
- tableColums(cDBOpen ) = &quot;open&quot;
- tableColums(cDBInsert ) = &quot;insert&quot;
- tableColums(cDBDelete ) = &quot;delete&quot;
- tableColums(cDBSeek ) = &quot;seek&quot;
- tableColums(cDBClose ) = &quot;close&quot;
-
- dim tableColums2(3) as string
- tableColums2(cEXTService ) = &quot;services&quot;
- tableColums2(cEXTInstall ) = &quot;install&quot;
- tableColums2(cEXTUninstall ) = &quot;uninstall&quot;
-
- aDoc = gOutPutDoc
-
- xText = aDoc.Text
- xCursor = xText.createTextCursor()
-
- xCursor.gotoStart(FALSE)
- xCursor.GoRight (4, False)
- SetParagraphBreak (xCursor)
- SetParagraphBreak (xCursor)
- xCursor.gotoEnd(FALSE)
-
- table = aDoc.createInstance(&quot;com.sun.star.text.TextTable&quot;)
- table.initialize(7,6)
- table.Name = &quot;StTab2&quot;
- &apos;table.RelativeWidth =500
-
- xText.insertTextContent(xCursor, table, FALSE)
-
- tableCursor = table.createCursorByCellName(table.CellNames(0))
- tableCursor.gotoStart(FALSE)
- tableCursor.goRight(1,FALSE)
-
- for i% = 0 to 5
- cName = tableCursor.getRangeName()
- xCell = table.getCellByName(cName)
- xCell.String=tableHeaders(i%)
-
- xCell.BackTransparent = False
- xCell.BackColor = cCoGrey
-
- tableCursor.goRight(1,FALSE)
- next i%
-
- tableCursor.gotoStart(FALSE)
-
- cName = tableCursor.getRangeName()
- xCell = table.getCellByName(cName)
- xCell.BackTransparent = False
- xCell.BackColor = cCoGrey
-
- for i% = 0 to 5
- tableCursor.goDown(1,FALSE)
- cName = tableCursor.getRangeName()
- xCell = table.getCellByName(cName)
- xCell.String=tableColums(i%)
-
- xCell.BackTransparent = False
- xCell.BackColor = cCoGrey
- next i%
-
- tableCursor.gotoStart(FALSE)
- tableCursor.goRight(2,FALSE)
-
- for i% = 0 to 3
- tableCursor.goDown(1,FALSE)
- cName = tableCursor.getRangeName()
- xCell = table.getCellByName(cName)
- xCell.String=tableColums2(i%)
-
- xCell.BackTransparent = False
- xCell.BackColor = cCoGrey
- next i%
-end Sub
-
-
-Sub CreateDocState
- aDoc = gOutPutDoc
- table = aDoc.TextTables.GetByIndex (1)
- &apos;table = aDoc.TextTables.GetByName (&quot;StTab1&quot;)
-
- for j% = 0 to 7
- for i% = 0 to 5
- sRangeName = GetRangeName(j%, i%+1)
-
- tableCursor = table.createCursorByCellName(sRangeName)
-
- cName = tableCursor.getRangeName()
- xCell = table.getCellByName(cName)
-
- xCell.BackTransparent = False
-
- if gErrorState (j%, i%) = cLogTrue then
- xCell.BackColor = cCoGreen
- else if gErrorState (j%, i%) = cLogFalse then
- xCell.BackColor = cCoRed
- else
- xCell.BackColor = cCoGrey
- end If
- end If
-
- next i%
- next j%
-end Sub
-
-Sub CreateSecondState
- aDoc = gOutPutDoc
- table = aDoc.TextTables.GetByIndex (0)
- &apos;table = aDoc.TextTables.GetByName (&quot;StTab2&quot;)
-
- for j% = 0 to cMaxErrorStates-9
- for i% = 0 to 5
- sRangeName = GetRangeName(j%, i%+1)
-
- tableCursor = table.createCursorByCellName(sRangeName)
-
- cName = tableCursor.getRangeName()
- xCell = table.getCellByName(cName)
-
- xCell.BackTransparent = False
-
- if gErrorState (j%+9, i%) = cLogTrue then
- xCell.BackColor = cCoGreen
- else if gErrorState (j%+9, i%) = cLogFalse then
- xCell.BackColor = cCoRed
- else
- xCell.BackColor = cCoGrey
- end If
- end If
-
- next i%
- next j%
-end Sub
-
-Function GetRangeName (nColumn as integer, nRow as integer) as string
- GetRangeName = chr (nColumn+66) + Trim(Str(nRow+1))
-end Function
-
-Sub SetStatus (nDocType as Integer, nAction as Integer, bState as Boolean)
- Dim nStatusType as Integer
- Dim nState as integer
- nStatusType = GetStatusType (nDocType)
- If nStatusType = cStNone then Exit Sub
-
- if bState then
- nState = cLogTrue
- else
- nState = cLogFalse
- end If
-
- gErrorState (nStatusType, nAction) = nState
-end Sub
-
-Function GetStatusType (nDocType as Integer) as Integer
- Select Case ( nDocType )
- case frmWriter
- GetStatusType = cStWriter &apos; Textdokument
- case frmCalc
- GetStatusType = cStCalc &apos;Tabellendokument
- case frmMessage
- GetStatusType = cStMessage &apos;Nachricht
- case frmImpress
- GetStatusType = cStPraesentation &apos;PrÃĪsentation
- case frmDraw
- GetStatusType = cStZeichnen &apos;Zeichnen
- case frmMath
- GetStatusType = cStMath &apos;Formel
- case frmImage
- GetStatusType = cStBild &apos;Bild
- case frmHyperText
- GetStatusType = cStHTML &apos;Hypertext-Dokument
- case frmChart
- GetStatusType = cStChart &apos;Diagramm
- case frmSchedule
- GetStatusType = cStSchedule &apos;Diagramm
- case frmJava
- GetStatusType = cStJava &apos;Java
- case frmNews
- GetStatusType = cStNews &apos;News
- case frmDataBase
- GetStatusType = cStDataBase &apos;DataBase
- case frmExtension
- GetStatusType = cStExtension &apos;Extension
- case else
- GetStatusType = cStNone
- end Select
-end Function
-
-Sub SetParagraphBreak (aCursor as Object)
- aCursor.Text.InsertControlCharacter (aCursor, cParagraphBreak, True)
-end Sub
-
-Sub ClearDoc (aDoc as Object)
- Dim aText as Object
- Dim i%
- for i%=1 to aDoc.TextTables.count
- aDoc.TextTables.GetByIndex(0).dispose
- next
-
- aText = aDoc.Text.CreateTextCursor
- aText.GotoStart (False)
- aText.GoRight (3, False)
- SetParagraphBreak (aText)
- aText.GotoEnd (True)
- aText.String=&quot;&quot;
-end Sub
-
-Sub ClearDocFull (aDoc as Object)
- Dim aText as Object
- Dim i%
- for i%=1 to aDoc.TextTables.count
- aDoc.TextTables.GetByIndex(0).dispose
- next
-
- aText = aDoc.Text.CreateTextCursor
- aText.GotoStart (False)
- aText.GotoEnd (True)
- aText.String=&quot;&quot;
-end Sub
-
-Sub SetGlobalOptionsDialog ()
-
- Dim oLibContainer As Object, oLib As Object
- Dim oInputStreamProvider As Object
- Dim oDialog As Object
-
- Const sLibName = cTest10Modul
- Const sDialogName = cOptionsDialogName
-
- REM get library and input stream provider
- oLibContainer = DialogLibraries
-
- REM load the library
- oLibContainer.loadLibrary( sLibName )
-
- oLib = oLibContainer.getByName( sLibName )
- oInputStreamProvider = oLib.getByName( sDialogName )
-
- REM create dialog control
- gOptionsDialog = CreateUnoDialog( oInputStreamProvider )
-
-end Sub
-
-Sub ShowOptionsDlg
-
- call SetGlobalDoc
- call SetGlobalOptionsDialog
- call GetOptions
-
- REM show the dialog
- gOptionsDialog.execute()
-
- &apos; jetzt lÃĪuft der Dialog, bis ein Button gedrÞckt wird
-
- Select Case (gDlgState)
- case cDlgOk
- call SetOptions ()
- case cDlgStartTest
- call SetOptions ()
- call StartTestByOptions ()
- end Select
-
- gOptionsDialog.dispose()
-
-end Sub
-
-Sub SetOptions
- call SetGlobalDoc
- SetUserFieldState (cUserFieldTestWriter, -(gOptionsDialog.getControl(&quot;cbWriterTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestCalc, -(gOptionsDialog.getControl(&quot;cbCalcTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestImpress, -(gOptionsDialog.getControl(&quot;cbImpressTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestDraw, -(gOptionsDialog.getControl(&quot;cbDrawTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestHTML, -(gOptionsDialog.getControl(&quot;cbHTMLTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestMath, -(gOptionsDialog.getControl(&quot;cbMathTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestChart, -(gOptionsDialog.getControl(&quot;cbChartTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestJava, -(gOptionsDialog.getControl(&quot;cbJavaTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestDatabase, -(gOptionsDialog.getControl(&quot;cbDatabaseTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestExtension, -(gOptionsDialog.getControl(&quot;cbExtensionTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestOpenSaveXML, -(gOptionsDialog.getControl(&quot;cbSaveOpenXMLTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestOpenSave50, -(gOptionsDialog.getControl(&quot;cbSaveOpen50Test&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestOpenSave8, -(gOptionsDialog.getControl(&quot;cbSaveOpen8Test&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestCut, -(gOptionsDialog.getControl(&quot;cbCutTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestPaste, -(gOptionsDialog.getControl(&quot;cbPasteTest&quot;).getState), gOutPutDoc)
- SetUserFieldState (cUserFieldTestTerminateAfterTest, -(gOptionsDialog.getControl(&quot;cbTerminateAfterTest&quot;).getState), gOutPutDoc)
-end Sub
-
-Sub GetOptions
- call SetGlobalDoc
- gOptionsDialog.getControl(&quot;cbWriterTest&quot;).setState( -( GetUserFieldState (cUserFieldTestWriter, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbCalcTest&quot;).setState ( -( GetUserFieldState (cUserFieldTestCalc, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbImpressTest&quot;).setState( -( GetUserFieldState (cUserFieldTestImpress, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbDrawTest&quot;).setState( -( GetUserFieldState (cUserFieldTestDraw, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbHTMLTest&quot;).setState( -( GetUserFieldState (cUserFieldTestHTML, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbMathTest&quot;).setState( -( GetUserFieldState (cUserFieldTestMath, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbChartTest&quot;).setState( -( GetUserFieldState (cUserFieldTestChart, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbJavaTest&quot;).setState( -( GetUserFieldState (cUserFieldTestJava, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbDatabaseTest&quot;).setState( -( GetUserFieldState (cUserFieldTestDatabase, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbExtensionTest&quot;).setState( -( GetUserFieldState (cUserFieldTestExtension, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbSaveOpenXMLTest&quot;).setState( -( GetUserFieldState (cUserFieldTestOpenSaveXML, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbSaveOpen50Test&quot;).setState( -( GetUserFieldState (cUserFieldTestOpenSave50, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbSaveOpen8Test&quot;).setState( -( GetUserFieldState (cUserFieldTestOpenSave8, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbCutTest&quot;).setState( -( GetUserFieldState (cUserFieldTestCut, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbPasteTest&quot;).setState( -( GetUserFieldState (cUserFieldTestPaste, gOutPutDoc)))
- gOptionsDialog.getControl(&quot;cbTerminateAfterTest&quot;).setState( -( GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutPutDoc)))
-End Sub
-
-Sub ReadOptions
- call SetGlobalDoc
- bTestDocs = true
- bMakeWriterTest = GetUserFieldState (cUserFieldTestWriter, gOutPutDoc)
- bMakeCalcTest = GetUserFieldState (cUserFieldTestCalc, gOutPutDoc)
- bMakeImpressTest = GetUserFieldState (cUserFieldTestImpress, gOutPutDoc)
- bMakeDrawTest = GetUserFieldState (cUserFieldTestDraw, gOutPutDoc)
- bMakeHTMLTest = GetUserFieldState (cUserFieldTestHTML, gOutPutDoc)
- bMakeMathTest = GetUserFieldState (cUserFieldTestMath, gOutPutDoc)
- bMakeChartTest = GetUserFieldState (cUserFieldTestChart, gOutPutDoc)
- bMakeJavaTest = GetUserFieldState (cUserFieldTestJava, gOutPutDoc)
- bMakeDBTest = GetUserFieldState (cUserFieldTestDatabase, gOutPutDoc)
- bMakeExtensionTest = GetUserFieldState (cUserFieldTestExtension, gOutPutDoc)
- bMakeSaveOpenXMLTest = GetUserFieldState (cUserFieldTestOpenSaveXML, gOutPutDoc)
- bMakeSaveOpen50Test = GetUserFieldState (cUserFieldTestOpenSave50, gOutPutDoc)
- bMakeSaveOpen8Test = GetUserFieldState (cUserFieldTestOpenSave8, gOutPutDoc)
- bMakeCutTest = GetUserFieldState (cUserFieldTestCut, gOutPutDoc)
- bMakePasteTest = GetUserFieldState (cUserFieldTestPaste, gOutPutDoc)
- bMakeTerminateAfterTest = GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutPutDoc)
-end Sub
-
-Sub SetDefaultOptions
- bTestDocs = true
- bMakeWriterTest = true
- bMakeCalcTest = true
- bMakeImpressTest = true
- bMakeDrawTest = true
- bMakeHTMLTest = true
- bMakeMathTest = true
- bMakeChartTest = true
- bMakeJavaTest = true
- bMakeDBTest = true
- bMakeExtensionTest = true
- bMakeSaveOpenXMLTest = true
- REM Disable StarOffice 5.0 tests in case binfilter has not been included
- if Environ(&quot;WITH_BINFILTER&quot;) = &quot;NO&quot; then
- bMakeSaveOpen50Test = false
- else
- bMakeSaveOpen50Test = true
- End If
- bMakeSaveOpen8Test = true
- bMakeCutTest = true
- bMakePasteTest = true
- bMakeTerminateAfterTest = true
-end Sub
-
-Sub ShutdownQuickstarter
- dim qs as Object
- qs = createUnoService(&quot;com.sun.star.comp.desktop.QuickstartWrapper&quot; )
- qs.setFastPropertyValue( 0, false )
-end Sub
-
-Sub StartTestByOptions
- call ShutdownQuickstarter
- bShowTable = true
- call ReadOptions
- call Main
-
- if bMakeTerminateAfterTest then
-
- ClearDocFull (gOutPutDoc)
- gOutPutDoc.dispose
- &apos;StarDesktop.Terminate
-
- &apos;EnableReschedule( false )
- &apos;DispatchSlot( 5300 )
- stop
- End If
-end Sub
-
-Sub StartTestWithDefaultOptions
- call ShutdownQuickstarter
- bShowTable = false
- call SetDefaultOptions
- call Main
-
- if bMakeTerminateAfterTest then
- stop
-
- ClearDocFull (gOutPutDoc)
- gOutPutDoc.dispose
- &apos;StarDesktop.Terminate
- &apos;EnableReschedule( false )
- &apos;DispatchSlot( 5300 )
- stop
- End If
-end Sub
-
-Sub DispatchSlot(SlotID as Integer)
- Dim oArg() as new com.sun.star.beans.PropertyValue
- Dim oUrl as new com.sun.star.util.URL
- Dim oTrans as Object
- Dim oDisp as Object
-
- oTrans = createUNOService(&quot;com.sun.star.util.URLTransformer&quot;)
- oUrl.Complete = &quot;slot:&quot; &amp; CStr(SlotID)
- oTrans.parsestrict(oUrl)
-
- oDisp = StarDesktop.queryDispatch(oUrl, &quot;_self&quot;, 0)
- oDisp.dispatch(oUrl, oArg())
-End Sub
-
-Sub LoadLibrary( LibName As String )
-
- dim args(1)
- dim arg as new com.sun.star.beans.PropertyValue
- arg.Name = &quot;LibraryName&quot;
- arg.Value = LibName
- args(0) = arg
-
- dim url as new com.sun.star.util.URL
- dim trans as object
- trans = createUnoService(&quot;com.sun.star.util.URLTransformer&quot; )
- url.Complete = &quot;slot:6517&quot;
- trans.parsestrict( url )
-
- dim disp as object
- disp = StarDesktop.currentFrame.queryDispatch( url, &quot;&quot;, 0 )
- disp.dispatch( url, args() )
-
-End Sub
-
-Sub ExecuteSlot( SlotNr As String, oDoc as Object )
- dim args()
- dim url as new com.sun.star.util.URL
- dim trans as object
- dim disp as object
-
- trans = createUnoService(&quot;com.sun.star.util.URLTransformer&quot; )
- url.Complete = &quot;slot:&quot; + SlotNr
- trans.parsestrict( url )
-
- disp = oDoc.CurrentController.Frame.queryDispatch( url, &quot;&quot;, 0 )
- disp.dispatch( url, args() )
-
-End Sub
-
-Sub CutText (oDoc as Object)
- ExecuteSlot (&quot;5710&quot;, oDoc)
-End Sub
-
-Sub PasteText (oDoc as Object)
- ExecuteSlot (&quot;5712&quot;, oDoc)
-End Sub
-
-Sub DelAllUserFields (aDoc as Object)
- Dim aFieldType as Object
- Dim aElements as Variant
- Dim i%
- Dim aFieldMasters, aFieldMaster as Object
- Dim sElement$
- aFieldMasters = aDoc.TextFieldMasters
- aElements = aFieldMasters.ElementNames
- for i = 0 to UBound(aElements)
- sElement$ = aElements(i)
- if 0 &lt;&gt; instr(sElement$, cUnoUserField ) then
- aFieldMaster = aFieldMasters.GetByName(sElement$)
- aFieldMaster.Dispose
- endif
- next
-end Sub
-
-Function GetUserFieldState (sName as String, aDoc as Object) as boolean
- Dim sFieldText as String
- Dim bState as boolean
- sFieldText = ReadUserField (sName, aDoc)
-
- if LCase(sFieldText) = cYes then
- bState = true
- else
- bState = false
- end IF
-
- GetUserFieldState = bState
-end Function
-
-Sub SetUserFieldState (sName as String, nState as boolean, aDoc as Object)
- Dim sFieldText as String
-
- sFieldText = cNo &apos;default
-
- Select case nState
- case true
- sFieldText = cYes
- case false
- sFieldText = cNo
- end Select
-
- WriteUserField (sFieldText, sName, aDoc)
-end Sub
-
-Function ReadUserField(sFieldName as String, aDoc as Object) as String
- Dim aMasters as Object
- aMasters = aDoc.TextFieldMasters
- if aMasters.HasByName (cUnoUserField+cUnoSeparator+sFieldName) then
- ReadUserField = aMasters.GetByName (cUnoUserField+cUnoSeparator+sFieldName).Content
- else
- ReadUserField = &quot;&quot;
- end If
-End Function
-
-Sub WriteUserField(sValue as String, sFieldName as String, aDoc as Object, optional aCursor as Object)
- Dim aMasters, aUserField, aTxtCursor as Object
- aMasters = aDoc.TextFieldMasters
- if aMasters.HasByName (cUnoUserField+cUnoSeparator+sFieldName) then
- aUserField = aMasters.GetByName (cUnoUserField+cUnoSeparator+sFieldName)
- else
- aUserField = aDoc.CreateInstance (cUnoUserField)
- aUserField.Name = sFieldName
- end if
- aUserField.Content = sValue
-End Sub
-
-Sub WriteExtUserField(nIndex as Integer, aCursor as Object, aDoc as Object)
- Dim aUserField as Object
- aUserField = aDoc.CreateInstance (cUnoExtUserField)
- aUserField.UserDataType = nIndex
- aCursor.Text.InsertTextContent (aCursor, aUserField, True)
- aUserField.Fix = True
-End Sub
-</script:module>
diff --git a/smoketestoo_native/data/scripts/Test_10er.xba b/smoketestoo_native/data/scripts/Test_10er.xba
deleted file mode 100755
index b475dfe53b42..000000000000
--- a/smoketestoo_native/data/scripts/Test_10er.xba
+++ /dev/null
@@ -1,907 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
-<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Test_10er" script:language="StarBasic">REM 10er Test
-
-const sSWLogFileName = &quot;swlog.dat&quot;, sSCLogFileName = &quot;sclog.dat&quot;
-const sSDLogFileName = &quot;sdlog.dat&quot;, sSMathLogFileName = &quot;smalog.dat&quot;
-const sSImDLogFileName = &quot;simlog.dat&quot;, sSChartLogFileName = &quot;schlog.dat&quot;
-const sSHptLogFileName = &quot;shptlog.dat&quot;, sSMessageLogFileName = &quot;smeslog.dat&quot;
-const sSDrawLogFileName = &quot;sdrwlog.dat&quot;, sJavaLogFileName = &quot;javalog.dat&quot;
-const sSDBLogFileName = &quot;dblog.dat&quot;, sExtLogFileName = &quot;extlog.dat&quot;
-const sLogFileName = &quot;log.dat&quot;
-const cTempFileName = &quot;ttt&quot;
-
-const cMessageSaveOpen8Doc = &quot;Save/Open open Documents (8.0)&quot;
-const cMessageSaveOpenXMLDoc = &quot;Save/Open Document XML (6/7)&quot;
-const cMessageSaveOpen50Doc = &quot;Save/Open Document 5.0&quot;
-const cMessageNewDoc = &quot;New Document&quot;
-const cMessageCloseDoc = &quot;Close Document&quot;
-const cMessageCutObj = &quot;Cut Object&quot;
-const cMessagePasteObj = &quot;Paste Object&quot;
-
-Global sWorkPath$
-Global sWorkPathURL$
-Global FileChannel%
-Global MainFileChannel%
-
-Sub Main
- call TestAllDocs()
-end Sub
-
-Sub DeleteAllSavedFiles()
- Dim sFileName as String
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmWriter)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmCalc)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmImpress)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmDraw)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmHyperText)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmWriter or cFltXML)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmCalc or cFltXML)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmImpress or cFltXML)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmDraw or cFltXML)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmWriter or cFlt50)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmCalc or cFlt50)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmImpress or cFlt50)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmDraw or cFlt50)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
-End Sub
-
-Sub DeleteAllLogFiles()
- If FileExists (sWorkPath+sLogFileName) then
- Kill (sWorkPath+sLogFileName)
- End If
- If FileExists (sWorkPath+sSWLogFileName) then
- Kill (sWorkPath+sSWLogFileName)
- End If
- If FileExists (sWorkPath+sSCLogFileName) then
- Kill (sWorkPath+sSCLogFileName)
- End If
- If FileExists (sWorkPath+sSDLogFileName) then
- Kill (sWorkPath+sSDLogFileName)
- End If
- If FileExists (sWorkPath+sSMathLogFileName) then
- Kill (sWorkPath+sSMathLogFileName)
- End If
- If FileExists (sWorkPath+sSImDLogFileName) then
- Kill (sWorkPath+sSImDLogFileName)
- End If
- If FileExists (sWorkPath+sSChartLogFileName) then
- Kill (sWorkPath+sSChartLogFileName)
- End If
- If FileExists (sWorkPath+sSHptLogFileName) then
- Kill (sWorkPath+sSHptLogFileName)
- End If
- If FileExists (sWorkPath+sSMessageLogFileName) then
- Kill (sWorkPath+sSMessageLogFileName)
- End If
- If FileExists (sWorkPath+sSDrawLogFileName) then
- Kill (sWorkPath+sSDrawLogFileName)
- End If
- If FileExists (sWorkPath+sJavaLogFileName) then
- Kill (sWorkPath+sJavaLogFileName)
- End If
- If FileExists (sWorkPath+sSDBLogFileName) then
- Kill (sWorkPath+sSDBLogFileName)
- End If
- If FileExists (sWorkPath+sExtLogFileName) then
- Kill (sWorkPath+sExtLogFileName)
- End If
-end Sub
-
-Function OpenLogDat (sFileName as String) as Integer
- Dim LocaleFileChannel%
- If FileExists (sWorkPath+sFileName) then
- Kill (sWorkPath+sFileName)
- End If
- LocaleFileChannel% = Freefile
- Open sWorkPath+sFileName For Output As LocaleFileChannel%
- OpenLogDat = LocaleFileChannel%
-end Function
-
-Function GetWorkPath as string
- sTemp = &quot;$(userpath)/temp/&quot;
- GetWorkPath = CreateUnoService(&quot;com.sun.star.config.SpecialConfigManager&quot;).SubstituteVariables(sTemp)
-End Function
-
-Function GetWorkURL as string
- sTemp = &quot;$(userurl)/temp/&quot;
- GetWorkURL = CreateUnoService(&quot;com.sun.star.config.SpecialConfigManager&quot;).SubstituteVariables(sTemp)
-End Function
-
-Function GetSystem (sTmpWorkPath as string) as string
- GetSystem = &quot;&quot;
- if InStr (sTmpWorkPath, &quot;:&quot;) then
- GetSystem = &quot;windows&quot;
- else
- GetSystem = &quot;unix&quot;
- End If
-end Function
-
-Function ConvertPathToWin (sTmpWorkPath as string) as string
- for i%=1 to Len(sTmpWorkPath)
- sTemp = Mid (sTmpWorkPath, i%, 1)
- if sTemp = &quot;/&quot; then
- sTmpWorkPath = Left (sTmpWorkPath, i%-1) + &quot;\&quot; + Right (sTmpWorkPath, Len(sTmpWorkPath)-i%)
- else
- if sTemp = &quot;|&quot; then
- sTmpWorkPath = Left (sTmpWorkPath, i%-1) + &quot;:&quot; + Right (sTmpWorkPath, Len(sTmpWorkPath)-i%)
- end If
- end If
- next i%
- ConvertPathToWin = sTmpWorkPath
-end Function
-
-Sub TestAllDocs()
-DIM sDocURL as String, sDocPath as String
-DIM nStrPos as Long
-
- sWorkPath = GetWorkPath
- sWorkPathURL = GetWorkURL
-
- if GetSystem (sWorkPath) = &quot;windows&quot; then
- sWorkPath = ConvertPathToWin (sWorkPath)
- end if
-
- &apos;search ExtensionURL
- sExtensionURL = sWorkPathURL
- If not FileExists (sExtensionURL + cExtensionFileName) then
- if bShowTable then
- sDocURL = gOutPutDoc.URL
- CompatibilityMode(true)
- nStrPos = InStrRev (sDocURL, &quot;/&quot; )
- CompatibilityMode(false)
- if nStrPos then
- sDocURL = Left (sDocURL, nStrPos)
- sExtensionURL = sDocURL
- If not FileExists (sExtensionURL + cExtensionFileName) then
- bMakeExtensionTest = false &apos; test is not possible then
- end if
- else
- bMakeExtensionTest = false &apos; test is not possible then
- end if
-
- else
- bMakeExtensionTest = false &apos; test is not possible then
- end if
-
- end if
-
- call DeleteAllSavedFiles()
- call DeleteAllLogFiles()
- MainFileChannel = OpenLogDat (sLogFileName)
- call WriteTestSequence (MainFileChannel)
- if bMakeWriterTest then
- call MakeDocTest (frmWriter)
- end if
- if bMakeCalcTest then
- call MakeDocTest (frmCalc)
- end if
- if bMakeImpressTest then
- call MakeDocTest (frmImpress)
- end if
- if bMakeDrawTest then
- call MakeDocTest (frmDraw)
- end if
- if bMakeHTMLTest then
- call MakeDocTest (frmHyperText)
- end if
- if bMakeChartTest then
- call MakeChartTest (frmChart)
- end if
- if bMakeMathTest then
- call MakeNewDoc (frmMath)
- end if
- if bMakeJavaTest then
- call TestJava (frmJava)
- end if
- if bMakeDBTest then
- call Test_DB.TestDB (frmDataBase)
- end if
- if bMakeExtensionTest then
- call Test_Ext.TestExtensions (frmExtension)
- end if
-
- Close #MainFileChannel
-end Sub
-
-Sub WriteTestSequence (FileChannel as integer)
- Print #FileChannel, &quot;Sequence of testing&quot;
-
- if bMakeWriterTest then
- WriteTests (&quot;writer : &quot;, true, FileChannel)
- end if
- if bMakeCalcTest then
- WriteTests (&quot;calc : &quot;, true, FileChannel)
- end if
- if bMakeImpressTest then
- WriteTests (&quot;impress : &quot;, true, FileChannel)
- end if
- if bMakeDrawTest then
- WriteTests (&quot;draw : &quot;, true, FileChannel)
- end if
- if bMakeHTMLTest then
- WriteTests (&quot;HTML : &quot;, true, FileChannel)
- end if
- if bMakeChartTest then
- WriteTests (&quot;chart : &quot;, false, FileChannel)
- end if
- if bMakeMathTest then
- WriteTests (&quot;math : &quot;, false, FileChannel)
- end if
- if bMakeJavaTest then
- WriteTests (&quot;Java : &quot;, false, FileChannel)
- end if
- if bMakeDBTest then
- WriteDBTests (&quot;Database : &quot;, FileChannel)
- end if
- if bMakeExtensionTest then
- WriteExtensionTests (&quot;Extension : &quot;, FileChannel)
- end if
-
- Print #FileChannel
-end Sub
-
-Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer)
- Dim sWriteStr as string
-
- sWriteStr = sText
- sWriteStr = sWriteStr + &quot;new&quot;
- if bTestAll then
- if bMakeCutTest then
- sWriteStr = sWriteStr + &quot;, cut&quot;
- end if
- if bMakePasteTest then
- sWriteStr = sWriteStr + &quot;, paste&quot;
- end if
- if bMakeSaveOpen8Test then
- sWriteStr = sWriteStr + &quot;, save 8.0&quot;
- end if
- if bMakeSaveOpenXMLTest then
- sWriteStr = sWriteStr + &quot;, save XML&quot;
- end if
- if bMakeSaveOpen50Test then
- sWriteStr = sWriteStr + &quot;, save 5.0&quot;
- end if
- if bMakeSaveOpen8Test then
- sWriteStr = sWriteStr + &quot;, open 8.0&quot;
- end if
- if bMakeSaveOpenXMLTest then
- sWriteStr = sWriteStr + &quot;, open XML&quot;
- end if
- if bMakeSaveOpen50Test then
- sWriteStr = sWriteStr + &quot;, open 5.0&quot;
- end if
- end if
-
- sWriteStr = sWriteStr + &quot;, close&quot;
-
- Print #nFileChannel, sWriteStr
-end Sub
-
-Sub WriteDBTests (sText as string, nFileChannel as integer)
- Dim sWriteStr as string
-
- sWriteStr = sText
- sWriteStr = sWriteStr + &quot;open / services&quot;
- sWriteStr = sWriteStr + &quot;, insert&quot;
- sWriteStr = sWriteStr + &quot;, delete&quot;
- sWriteStr = sWriteStr + &quot;, seek&quot;
- sWriteStr = sWriteStr + &quot;, close&quot;
-
- Print #nFileChannel, sWriteStr
-end Sub
-
-Sub WriteExtensionTests (sText as string, nFileChannel as integer)
- Dim sWriteStr as string
-
- sWriteStr = sText
- sWriteStr = sWriteStr + &quot;services&quot;
- sWriteStr = sWriteStr + &quot;, install&quot;
- sWriteStr = sWriteStr + &quot;, uninstall&quot;
-
- Print #nFileChannel, sWriteStr
-end Sub
-
-Sub MakeDocTest (FilterType as Integer)
- Dim oDoc as Object
- Dim sFileNameXML$, sFileName50$, sFileName8$
- Dim bError as Boolean
- Dim nCurrentAction as Integer
-
- On Local Error GoTo DOCTESTERROR
- nCurrentAction = cLogfileFailed
- FileChannel% = OpenLogDat (GetLogFileName(FilterType))
- nCurrentAction = cDocNew
- oDoc = LoadDoc (&quot;private:factory/&quot; + GetDocFilter(FilterType or cFltNewDoc))
- LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, FileChannel)
- LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, MainFileChannel)
- SetStatus (FilterType, cDocNew, not IsNull (oDoc))
- if not IsNull (oDoc) then
- nCurrentAction = cDocCut
- call CutAndPaste(FilterType, oDoc)
-&apos; bError = oDoc.CurrentController.frame.close
- nCurrentAction = cDocSaveOpen8
- if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then
- sFileName8 = sWorkPathURL+cTempFileName+&quot;.&quot;+GetDocEndings(FilterType or cFlt8)
- SaveDoc (sFileName8, oDoc, GetDocFilter(FilterType or cFlt8))
- end if
- nCurrentAction = cDocSaveOpenXML
- if bMakeSaveOpenXMLTest and IsFilterAvailable (FilterType or cFltXML) then
- sFileNameXML = sWorkPathURL+cTempFileName+&quot;.&quot;+GetDocEndings(FilterType or cFltXML)
- SaveDoc (sFileNameXML, oDoc, GetDocFilter(FilterType or cFltXML))
- end if
- nCurrentAction = cDocSaveOpen50
- if bMakeSaveOpen50Test and IsFilterAvailable (FilterType or cFlt50) then
- sFileName50 = sWorkPathURL+cTempFileName+&quot;.&quot;+GetDocEndings(FilterType or cFlt50)
- SaveDoc (sFileName50, oDoc, GetDocFilter(FilterType or cFlt50))
- end if
-&apos; oDoc.dispose
- nCurrentAction = cDocClose
- oDoc.close (true)
-&apos; bError = true &apos; nur zum ÂĶbergang, weil bError = oDoc.CurrentController.frame.close nicht geht
-&apos; LogState (bError, GetDocFilter(FilterType)+&quot; &quot;+ cMessageCloseDoc, FileChannel)
-&apos; LogState (bError, GetDocFilter(FilterType)+&quot; &quot;+ cMessageCloseDoc, MainFileChannel)
-&apos; SetStatus (FilterType, cDocClose, bError)
- nCurrentAction = cDocSaveOpen8
- if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then
- oDoc = LoadDoc (sFileName8)
-
-&apos; oDoc = Documents.open(sFileName)
- LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpen8Doc, FileChannel)
- LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpen8Doc, MainFileChannel)
- SetStatus (FilterType, cDocSaveOpen8, not IsNull (oDoc))
-
- if not IsNull (oDoc) then
-&apos; oDoc.dispose
- nCurrentAction = cDocClose
- oDoc.close (true)
- end If
- end if
-
- nCurrentAction = cDocSaveOpenXML
- if bMakeSaveOpenXMLTest and IsFilterAvailable (FilterType or cFltXML) then
- oDoc = LoadDoc (sFileNameXML)
-
-&apos; oDoc = Documents.open(sFileName)
- LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpenXMLDoc, FileChannel)
- LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpenXMLDoc, MainFileChannel)
- SetStatus (FilterType, cDocSaveOpenXML, not IsNull (oDoc))
-
- if not IsNull (oDoc) then
-&apos; oDoc.dispose
- nCurrentAction = cDocClose
- oDoc.close (true)
- end If
- end if
-
- nCurrentAction = cDocSaveOpen50
- if bMakeSaveOpen50Test and IsFilterAvailable (FilterType or cFlt50) then
- oDoc = LoadDoc (sFileName50)
-
-&apos; oDoc = Documents.open(sFileName)
- LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpen50Doc, FileChannel)
- LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpen50Doc, MainFileChannel)
- SetStatus (FilterType, cDocSaveOpen50, not IsNull (oDoc))
-
- if not IsNull (oDoc) then
-&apos; oDoc.dispose
- nCurrentAction = cDocClose
- oDoc.close (true)
- end If
- end if
- end If
- Print #FileChannel, &quot;---&quot;
- Close #FileChannel%
- Exit Sub &apos; Without error
-
- DOCTESTERROR:
- If (nCurrentAction = cLogfileFailed) then
- SetStatus (FilterType, cDocNew, False)
- Exit Sub
- else
- LogState (False, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(nCurrentAction), FileChannel)
- LogState (False, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(nCurrentAction), MainFileChannel)
- SetStatus (FilterType, nCurrentAction, False)
- Close #FileChannel%
- End If
- Exit Sub &apos; With error
-End Sub
-
-Sub MakeNewDoc (FilterType as Integer)
- DIM oDoc as Object
- Dim bError as Boolean
- Dim nCurrentAction as Integer
- On Local Error GoTo DOCTESTERROR2
- nCurrentAction = cLogfileFailed
- FileChannel% = OpenLogDat (GetLogFileName(FilterType))
- nCurrentAction = cDocNew
-&apos; oDoc = Documents.Add(GetDocFilter(FilterType))
- oDoc = LoadDoc (&quot;private:factory/&quot; + GetDocFilter(FilterType or cFltNewDoc))
- LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, FileChannel)
- LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, MainFileChannel)
- SetStatus (FilterType, cDocNew, not IsNull (oDoc))
- if not IsNull (oDoc) then
- nCurrentAction = cDocClose
-&apos; oDoc.dispose
- oDoc.close (true)
-&apos; bError = true &apos; nur zum ÂĶbergang, weil bError = oDoc.CurrentController.frame.close nicht geht
-&apos; LogState (bError, GetDocFilter(FilterType)+&quot; &quot;+ cMessageCloseDoc, FileChannel)
-&apos; LogState (bError, GetDocFilter(FilterType)+&quot; &quot;+ cMessageCloseDoc, MainFileChannel)
-&apos; SetStatus (FilterType, cDocClose, bError)
- end If
- Print #FileChannel, &quot;---&quot;
- Close #FileChannel%
- Exit Sub &apos; Without error
-
- DOCTESTERROR2:
- If (nCurrentAction = cLogfileFailed) then
- SetStatus (FilterType, cDocNew, False)
- Exit Sub
- else
- LogState (False, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(nCurrentAction), FileChannel)
- LogState (False, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(nCurrentAction), MainFileChannel)
- SetStatus (FilterType, nCurrentAction, False)
- Close #FileChannel%
- End If
- Exit Sub &apos; With error
-End Sub
-
-Sub MakeChartTest (FilterType as Integer)
- Dim oCharts as Object
- Dim oDoc as Object
- Dim oRange(0) as New com.sun.star.table.CellRangeAddress
- Dim oRect as New com.sun.star.awt.Rectangle
- const cChartName=&quot;TestChart&quot;
- Dim bError as Boolean
- Dim nCurrentAction as Integer
- On Local Error GoTo CHARTTESTERROR
- nCurrentAction = cLogfileFailed
- FileChannel% = OpenLogDat (GetLogFileName(FilterType))
- nCurrentAction = cDocNew
- oDoc = LoadDoc (&quot;private:factory/&quot; + GetDocFilter(frmCalc or cFltNewDoc))
- if not IsNull (oDoc) then
- oCharts = oDoc.sheets(0).Charts
- oCharts.AddNewByName (cChartName, oRect, oRange(), true, true)
- bError=oCharts.HasByName(cChartName)
- LogState (bError, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, FileChannel)
- LogState (bError, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, MainFileChannel)
- SetStatus (FilterType, cDocNew, bError)
-&apos; oDoc.dispose
- nCurrentAction = cDocClose
- oDoc.close (true)
- else
- LogState (not IsNull (oDoc), GetDocFilter(frmCalc or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, FileChannel)
- LogState (not IsNull (oDoc), GetDocFilter(frmCalc or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, MainFileChannel)
- SetStatus (frmCalc, cDocNew, not IsNull (oDoc))
- End if
- Print #FileChannel, &quot;---&quot;
- Close #FileChannel%
- Exit Sub &apos; Without error
-
- CHARTTESTERROR:
- If (nCurrentAction = cLogfileFailed) then
- SetStatus (FilterType, cDocNew, False)
- Exit Sub
- else
- LogState (False, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(nCurrentAction), FileChannel)
- LogState (False, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(nCurrentAction), MainFileChannel)
- SetStatus (FilterType, nCurrentAction, False)
- Close #FileChannel%
- End If
- Exit Sub &apos; With error
-End Sub
-
-Sub LogState (bState as Boolean, sText as String, nLocaleFileChannel as integer)
- if bState then
- Print #nLocaleFileChannel, sText+&quot; -&gt; ok&quot;
- else
- Print #nLocaleFileChannel, sText+&quot; -&gt; error&quot;
- end If
-end Sub
-
-Function GetDocEndings (DocType as Integer) as String
- Select Case ( DocType )
- case frmWriter or cFlt8
- GetDocEndings = &quot;odt&quot; &apos; Textdokument
- case frmCalc or cFlt8
- GetDocEndings = &quot;ods&quot; &apos;Tabellendokument
- case frmImpress or cFlt8
- GetDocEndings = &quot;odp&quot; &apos;PrÕsentation
- case frmDraw or cFlt8
- GetDocEndings = &quot;odg&quot; &apos;Zeichen
- case frmHyperText, frmHyperText or cFlt50, frmHyperText or cFltXML
- GetDocEndings = &quot;html&quot; &apos;Hypertext-Dokument
- case frmWriter or cFlt50
- GetDocEndings = &quot;sdw&quot; &apos; Textdokument 5.0
- case frmCalc or cFlt50
- GetDocEndings = &quot;sdc&quot; &apos;Tabellendokument 5.0
- case frmImpress or cFlt50
- GetDocEndings = &quot;sdd&quot; &apos;PrÕsentation 5.0
- case frmDraw or cFlt50
- GetDocEndings = &quot;sda&quot; &apos;Zeichen 5.0
- case frmWriter or cFltXML
- GetDocEndings = &quot;sxw&quot; &apos; Textdokument
- case frmCalc or cFltXML
- GetDocEndings = &quot;sxc&quot; &apos;Tabellendokument
- case frmImpress or cFltXML
- GetDocEndings = &quot;sxi&quot; &apos;PrÕsentation
- case frmDraw or cFltXML
- GetDocEndings = &quot;sxd&quot; &apos;Zeichen
- case else
- GetDocEndings = &quot;&quot;
- end Select
-end Function
-
-Function GetDocFilter (DocType as Integer) as String
- Select Case ( DocType )
- case frmWriter or cFlt8
- GetDocFilter = &quot;writer8&quot; &apos; Textdokument
- case frmCalc or cFlt8
- GetDocFilter = &quot;calc8&quot; &apos;Tabellendokument
- case frmImpress or cFlt8
- GetDocFilter = &quot;impress8&quot; &apos;PrÃĪsentation
- case frmDraw or cFlt8
- GetDocFilter = &quot;draw8&quot; &apos;Zeichen
- case frmMath or cFlt8
- GetDocFilter = &quot;math8&quot; &apos;Formel
-
- case frmWriter or cFltXML
- GetDocFilter = &quot;StarOffice XML (Writer)&quot; &apos; Textdokument
- case frmCalc or cFltXML
- GetDocFilter = &quot;StarOffice XML (Calc)&quot; &apos;Tabellendokument
- case frmImpress or cFltXML
- GetDocFilter = &quot;StarOffice XML (Impress)&quot; &apos;PrÃĪsentation
- case frmDraw or cFltXML
- GetDocFilter = &quot;StarOffice XML (Draw)&quot; &apos;Zeichen
- case frmMath or cFltXML
- GetDocFilter = &quot;StarOffice XML (Math)&quot; &apos;Formel
-
- case frmHyperText, frmHyperText or cFlt50, frmHyperText or cFltXML
- GetDocFilter = &quot;HTML&quot; &apos;Hypertext-Dokument
- case frmWriter or cFlt50
- GetDocFilter = &quot;StarWriter 5.0&quot; &apos; Textdokument 5.0
- case frmCalc or cFlt50
- GetDocFilter = &quot;StarCalc 5.0&quot; &apos;Tabellendokument 5.0
- case frmImpress or cFlt50
- GetDocFilter = &quot;StarImpress 5.0&quot; &apos;PrÃĪsentation 5.0
- case frmDraw or cFlt50
- GetDocFilter = &quot;StarDraw 5.0&quot; &apos;Zeichen 5.0
- case frmMath or cFlt50
- GetDocFilter = &quot;StarMath 5.0&quot; &apos;Formel 5.0
-
- case frmWriter or cFltNewDoc
- GetDocFilter = &quot;swriter&quot; &apos; Textdokument
- case frmCalc or cFltNewDoc
- GetDocFilter = &quot;scalc&quot; &apos;Tabellendokument
- case frmMessage or cFltNewDoc
- GetDocFilter = &quot;Message&quot; &apos;Nachricht
- case frmImpress or cFltNewDoc
- GetDocFilter = &quot;simpress&quot; &apos;PrÃĪsentation
- case frmDraw or cFltNewDoc
- GetDocFilter = &quot;sdraw&quot; &apos;Zeichen
- case frmMath or cFltNewDoc
- GetDocFilter = &quot;smath&quot; &apos;Formel
- case frmImage or cFltNewDoc
- GetDocFilter = &quot;simage&quot; &apos;Bild
- case frmHyperText or cFltNewDoc
- GetDocFilter = &quot;swriter/web&quot; &apos;Hypertext-Dokument
- case frmChart or cFltNewDoc
- GetDocFilter = &quot;schart&quot; &apos;Diagramm
- case else
- GetDocFilter = &quot;&quot;
- end Select
-end Function
-
-Function GetLogFileName (DocType as Integer) as String
- Select Case ( DocType )
- case frmWriter
- GetLogFileName = sSWLogFileName &apos; Textdokument
- case frmCalc
- GetLogFileName = sSCLogFileName &apos;Tabellendokument
- case frmMessage
- GetLogFileName = sSMessageLogFileName &apos;Nachricht
- case frmImpress
- GetLogFileName = sSDLogFileName &apos;PrÕsentation
- case frmDraw
- GetLogFileName = sSDrawLogFileName &apos;Zeichnen
- case frmMath
- GetLogFileName = sSMathLogFileName &apos;Formel
- case frmImage
- GetLogFileName = sSImDLogFileName &apos;Bild
- case frmHyperText
- GetLogFileName = sSHptLogFileName &apos;Hypertext-Dokument
- case frmChart
- GetLogFileName = sSChartLogFileName &apos;Diagramm
- case frmJava
- GetLogFileName = sJavaLogFileName &apos;Java
- case frmDataBase
- GetLogFileName = sSDBLogFileName &apos;Database
- case frmExtension
- GetLogFileName = sExtLogFileName &apos;Extension
- case else
- GetLogFileName = &quot;&quot;
- end Select
-end Function
-
-Function GetErrorMessageOnAction (nAction as Integer) as String
- Select Case ( nAction )
- case cDocNew
- GetErrorMessageOnAction = cMessageNewDoc
- case cDocCut
- GetErrorMessageOnAction = cMessageCutObj
- case cDocPaste
- GetErrorMessageOnAction = cMessagePasteObj
- case cDocSaveOpen8
- GetErrorMessageOnAction = cMessageSaveOpen8Doc
- case cDocSaveOpenXML
- GetErrorMessageOnAction = cMessageSaveOpenXMLDoc
- case cDocSaveOpen50
- GetErrorMessageOnAction = cMessageSaveOpen50Doc
- case cDocClose
- GetErrorMessageOnAction = cMessageCloseDoc
- case else
- GetErrorMessageOnAction = &quot;&quot;
- end Select
-end Function
-
-Function IsFilterAvailable (FilterType as Integer) as boolean
- IsFilterAvailable = true
- if ((FilterType = (frmHyperText or cFlt50)) or (FilterType = (frmHyperText or cFltXML))) then
- IsFilterAvailable = false
- end if
-End Function
-
-Function TestJava (FilterType as Integer) as boolean
- Dim oObj as Object
- FileChannel% = OpenLogDat (GetLogFileName(FilterType))
- oObj = createUnoService(cUnoJavaLoader)
- LogState (not IsNull (oObj), &quot;Java &quot;+ cMessageNewDoc, FileChannel)
- LogState (not IsNull (oObj), &quot;Java &quot;+ cMessageNewDoc, MainFileChannel)
- SetStatus (FilterType, cDocNew, not IsNull (oObj))
-
- Print #FileChannel, &quot;---&quot;
- Close #FileChannel%
-
- TestJava = not IsNull (oObj)
-End Function
-
-Sub CutAndPaste (DocType as Integer, oDoc as Object)
- Dim sText as String
- Dim oWin as Object
- Dim oText as Object
- Dim oView as Object
- Dim bCutState as boolean, bPasteState as boolean
- Select Case ( DocType )
- case frmWriter
- Dim oCursor as Object
-
- sText = &quot;AutomaticText&quot;
- oText = oDoc.GetText
- oCursor = oText.CreateTextCursor
- oText.InsertString(oCursor, sText, true) &apos; Cursor selektiert den Text
- oView = oDoc.getCurrentController
- oView.Select(oCursor)
-
- if bMakeCutTest then
- call CutText (oDoc)
-
- if oText.GetString = &quot;&quot; Then
- bCutState = True
- else
- bCutState = False
- end If
- SetStatus (DocType, cDocCut, bCutState)
- LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, FileChannel)
- LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, MainFileChannel)
- end if
-
- if bMakePasteTest and bMakeCutTest then
- call PasteText (oDoc)
-
- if oText.GetString = sText Then
- bPasteState = True
- else
- bPasteState = False
- end If
- SetStatus (DocType, cDocPaste, bPasteState)
- LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, FileChannel)
- LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, MainFileChannel)
- end if
-
- case frmCalc
- DIM oCell as Object
-
- sText = &quot;AutomaticText&quot;
- oCell = oDoc.Sheets(0).GetCellByPosition(0, 0)
- oCell.String = sText
- oView = oDoc.getCurrentController
- oView.Select(oCell)
-
- if bMakeCutTest then
- call CutText (oDoc)
-
- if oCell.String = &quot;&quot; Then
- bCutState = True
- else
- bCutState = False
- end If
- SetStatus (DocType, cDocCut, bCutState)
- LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, FileChannel)
- LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, MainFileChannel)
- end if
-
- if bMakePasteTest and bMakeCutTest then
- call PasteText (oDoc)
-
- if oCell.String = sText Then
- bPasteState = True
- else
- bPasteState = False
- end If
- SetStatus (DocType, cDocPaste, bPasteState)
- LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, FileChannel)
- LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, MainFileChannel)
- end if
- case frmMessage
- case frmImpress, frmDraw
- Dim oPage as Object
- Dim oRect as Object
- Dim xSize as Object
- Dim xPoint as Object
- Dim bObjState as Boolean
-
- xSize = CreateUnoStruct (&quot;com.sun.star.awt.Size&quot;)
- xPoint = CreateUnoStruct (&quot;com.sun.star.awt.Point&quot;)
- xSize.Width = 2000
- xSize.Height = 2000
- xPoint.x = 10000
- xPoint.y = 10000
- oPage = oDoc.DrawPages(0)
- oRect = oDoc.CreateInstance(&quot;com.sun.star.drawing.RectangleShape&quot;)
- oRect.Size = xSize
- oRect.Position = xPoint
- oPage.add(oRect)
-
- oView = oDoc.getCurrentController
- oView.Select(oRect)
-
- &apos; PrÞft ob Þberhaupt ein Object angelegt wurde
- if oPage.count = 1 Then
- bObjState = True
- else
- bObjState = False
- end If
-
- if bMakeCutTest then
- call CutText (oDoc)
-
- if (oPage.count = 0) and bObjState Then
- bCutState = True
- else
- bCutState = False
- end If
- SetStatus (DocType, cDocCut, bCutState)
- LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, FileChannel)
- LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, MainFileChannel)
- end if
-
- wait (1000) &apos;wait after cut
-
- if bMakePasteTest and bMakeCutTest then
- call PasteText (oDoc)
-
- if (oPage.count = 1) and bObjState Then
- bPasteState = True
- else
- bPasteState = False
- end If
- SetStatus (DocType, cDocPaste, bPasteState)
- LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, FileChannel)
- LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, MainFileChannel)
- end if
- case frmMath
- case frmImage
- case frmHyperText
- case frmChart
- end Select
-end Sub
-
-Sub LoadLibrary( LibName as String )
-
- dim args(1)
- dim arg as new com.sun.star.beans.PropertyValue
- arg.Name = &quot;LibraryName&quot;
- arg.Value = LibName
- args(0) = arg
-
- dim url as new com.sun.star.util.URL
- dim trans as object
- trans = createUnoService(&quot;com.sun.star.util.URLTransformer&quot; )
- url.Complete = &quot;slot:6517&quot;
- trans.parsestrict( url )
-
- dim disp as object
- disp = StarDesktop.currentFrame.queryDispatch( url, &quot;&quot;, 0 )
- disp.dispatch( url, args() )
-
-End Sub
-
-Sub LoadDoc (DocName as String) as Object
- dim trans as object
- trans = createUnoService(&quot;com.sun.star.util.URLTransformer&quot; )
- url = createUnoStruct(&quot;com.sun.star.util.URL&quot; )
- url.Complete = DocName
- if Left(DocName, 5 ) &lt;&gt; &quot;file:&quot; then
- trans.parsestrict( url )
- endif
-
- Dim aPropArray(0) as Object
- aPropArray(0) = CreateUnoStruct(&quot;com.sun.star.beans.PropertyValue&quot;)
- aPropArray(0).Name = &quot;OpenFlags&quot;
- aPropArray(0).Value = &quot;S&quot;
-
- dim doc as object
- dim noargs()
- doc = StarDesktop.loadComponentFromURL( url.Complete, &quot;_blank&quot;, 0, aPropArray() ) &apos; XModel
- LoadDoc = doc
-End Sub
-
-Sub SaveDoc (DocName as String, oDoc as Object, sFilterName as string )
- dim trans as object
- trans = createUnoService(&quot;com.sun.star.util.URLTransformer&quot; )
- url = createUnoStruct(&quot;com.sun.star.util.URL&quot; )
- url.Complete = DocName
- if Left(DocName, 5 ) &lt;&gt; &quot;file:&quot; then
- trans.parsestrict( url )
- endif
-
- if not (sFilterName = &quot;&quot;) then
- Dim aPropArray(0) as Object
- aPropArray(0) = CreateUnoStruct(&quot;com.sun.star.beans.PropertyValue&quot;)
- aPropArray(0).Name = &quot;FilterName&quot;
- aPropArray(0).Value = sFilterName
-
- oDoc.storeAsURL( url.Complete, aPropArray() )
- else
- MessageBox &quot;Filtername is unknown!&quot;
- end if
-end Sub
-</script:module> \ No newline at end of file
diff --git a/smoketestoo_native/data/scripts/Test_DB.xba b/smoketestoo_native/data/scripts/Test_DB.xba
deleted file mode 100755
index 7e5a74bfe2ab..000000000000
--- a/smoketestoo_native/data/scripts/Test_DB.xba
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
-<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Test_DB" script:language="StarBasic">REM ***** Database Test *****
-
-const cMessageDatabaseService = &quot;Database Service&quot;
-const cMessageDatabaseOpen = &quot;Open Database&quot;
-const cMessageDatabaseInsert = &quot;Insert record into Database&quot;
-const cMessageDatabaseDelete = &quot;Delete record from Database&quot;
-const cMessageDatabaseSeek = &quot;Read other record from Database&quot;
-const cMessageDatabaseClose = &quot;Close Database&quot;
-
-Sub TestDB (FilterType as Integer)
-
-Dim oDBConnection as Object, oDataSource as Object, oDBContext as Object
-Dim sDBName as String, sTable as String, sCurrentMessage as String
-Dim nRowCount as Integer, nCurrentAction as Integer
-Dim bResult as Boolean
-Const sTestString = &quot;Automatical Test&quot;
-
-
- On Local Error GoTo DBERROR
-
- nCurrentAction = cLogfileFailed
- FileChannel% = OpenLogDat (GetLogFileName(FilterType))
-
- nCurrentAction = cDBService
- sCurrentMessage = cMessageDatabaseService + &quot; &quot; + cUnoDatabaseContext
-
- oDBContext = CreateUnoService(cUnoDatabaseContext)
- sDBName=oDBContext.ElementNames(0) &apos;Names of Databases
-
- nCurrentAction = cDBOpen
- sCurrentMessage = cMessageDatabaseOpen
-
- oDataSource = oDBContext.GetByName(sDBName)
- sTable=oDataSource.Tables.ElementNames(0)
- oDBConnection = oDBContext.GetByName(sDBName).GetConnection(&quot;&quot;,&quot;&quot;)
-
- LogState (not IsNull (oDBConnection), &quot;Database &quot;+ cMessageDatabaseOpen, FileChannel)
- LogState (not IsNull (oDBConnection), &quot;Database &quot;+ cMessageDatabaseOpen, MainFileChannel)
- SetStatus (FilterType, cDBOpen, not IsNull (oDBConnection))
- if (IsNull(oDBConnection)) then
- Close #FileChannel%
- Exit Sub
- End If
-
- &apos; Database is open now
-
- nCurrentAction = cDBService
- sCurrentMessage = cMessageDatabaseService + &quot; &quot; + cUnoRowSet
- oRowSet = createUnoService(cUnoRowSet)
-
- if (IsNull(oRowSet)) then
- LogState (not IsNull (oRowSet), &quot;Database &quot;+ cMessageDatabaseService + &quot; &quot; + cUnoRowSet, FileChannel)
- LogState (not IsNull (oRowSet), &quot;Database &quot;+ cMessageDatabaseService + &quot; &quot; + cUnoRowSet, MainFileChannel)
- SetStatus (FilterType, cDBService, not IsNull (oRowSet))
- Exit Sub
- else
- LogState (not IsNull (oRowSet), &quot;Database &quot;+ cMessageDatabaseService, FileChannel)
- LogState (not IsNull (oRowSet), &quot;Database &quot;+ cMessageDatabaseService, MainFileChannel)
- SetStatus (FilterType, cDBService, not IsNull (oRowSet))
- End If
-
- nCurrentAction = cDBInsert
- sCurrentMessage = cMessageDatabaseInsert
-
- oRowSet.ActiveConnection = oDBConnection
-
- oRowSet.CommandType = com.sun.star.sdb.CommandType.COMMAND
- oRowSet.Command = &quot;SELECT * FROM &quot; + sTable
- oRowSet.execute()
-
- oRowSet.moveToInsertRow
- oRowSet.updateString(5, sTestString)
-
- oRowSet.insertRow()
- nRowCount=oRowSet.RowCount
-
- oRowSet.moveToCurrentRow()
-
- bResult = (oRowSet.getString(5) = sTestString)
- LogState (bResult, &quot;Database &quot;+ cMessageDatabaseInsert, FileChannel)
- LogState (bResult, &quot;Database &quot;+ cMessageDatabaseInsert, MainFileChannel)
- SetStatus (FilterType, cDBInsert, bResult)
-
- &apos;delete only if insert passed
-
- if (bResult) Then
- nCurrentAction = cDBDelete
- sCurrentMessage = cMessageDatabaseDelete
- oRowSet.deleteRow()
- bResult = (nRowCount - oRowSet.RowCount = 0)
- if ( bResult ) Then
- oRowSet.next()
- bResult = (nRowCount - oRowSet.RowCount = 1)
- End If
- LogState (bResult, &quot;Database &quot;+ cMessageDatabaseDelete, FileChannel)
- LogState (bResult, &quot;Database &quot;+ cMessageDatabaseDelete, MainFileChannel)
- SetStatus (FilterType, cDBDelete, bResult)
- End If
-
- &apos; read other record
-
- nCurrentAction = cDBSeek
- sCurrentMessage = cMessageDatabaseSeek
- oRowSet.first()
- bResult = not (oRowSet.getString(5) = sTestString)
- LogState (bResult, &quot;Database &quot;+ cMessageDatabaseSeek, FileChannel)
- LogState (bResult, &quot;Database &quot;+ cMessageDatabaseSeek, MainFileChannel)
- SetStatus (FilterType, cDBSeek, bResult)
-
- nCurrentAction = cDBClose
- sCurrentMessage = cMessageDatabaseClose
- oDBConnection.Dispose()
- LogState (True, &quot;Database &quot;+ cMessageDatabaseClose, FileChannel)
- LogState (True, &quot;Database &quot;+ cMessageDatabaseClose, MainFileChannel)
- SetStatus (FilterType, cDBClose, True)
-
- Print #FileChannel, &quot;---&quot;
- Close #FileChannel%
- Exit Sub &apos; Without error
-
- DBERROR:
- If (nCurrentAction = cLogfileFailed) then
- SetStatus (FilterType, cDBOpen, False)
- Exit Sub
- else
- LogState (False, &quot;Database &quot;+ sCurrentMessage, FileChannel)
- LogState (False, &quot;Database &quot;+ sCurrentMessage, MainFileChannel)
- SetStatus (FilterType, nCurrentAction, False)
- Close #FileChannel%
- End If
- Exit Sub &apos; With error
-End Sub
-</script:module> \ No newline at end of file
diff --git a/smoketestoo_native/data/scripts/Test_Ext.xba b/smoketestoo_native/data/scripts/Test_Ext.xba
deleted file mode 100755
index 00fc93ff86eb..000000000000
--- a/smoketestoo_native/data/scripts/Test_Ext.xba
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
-<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Test_Ext" script:language="StarBasic">REM ***** BASIC *****
-
-const cMessageExtensionService = &quot;Extension Service&quot;
-const cMessageExtensionInstall = &quot;Install Extension&quot;
-const cMessageExtensionUninstall = &quot;Uninstall Extension&quot;
-
-Sub TestExtensions (FilterType as Integer)
-Dim oTestExtension as Object, obj_null as Object
-Dim sCurrentMessage as String
-Dim nCurrentAction as Integer
-Dim bResult as Boolean
-Dim sImplementationNameString as String
-sImplementationNameString = cUnoSmoketestTestExtension + &quot;$_TestExtension&quot;
-
- On Local Error GoTo EXTERROR
-
- nCurrentAction = cLogfileFailed
- FileChannel% = OpenLogDat (GetLogFileName(FilterType))
-
- sCurrentMessage = cMessageExtensionService
- nCurrentAction = cEXTService
-
- &apos;Create an implementation of com.sun.star.ucb.XCommandEnvironment which is needed for
- &apos;adding the extension. The implementation is in
- &apos;javaunohelper/com/sun/star/comp/juhtest/SmoketestCommandEnvironment.java and the code is in juh.jar
- cmdEnv = createUnoService(cUnoSmoketestCommandEnvironment)
-
- &apos;Create the component context and then get the singleton thePackageManagerFactory
- &apos;A singleton cannot be created with createUnoService
- ctx = getDefaultContext
- factory = ctx.getValueByName(&quot;/singletons/&quot; + cUnothePackageManagerFactory)
-
- &apos;Get the XPackageManager interface. By passing &quot;user&quot; we determine that the actions we perform on
- &apos;XPackageManager only affect the user installation. To modify the share installation one would pass &quot;share&quot;.
- ext_mgr = factory.getPackageManager(&quot;user&quot;)
-
- LogState (not IsNull (ext_mgr), &quot;Extension &quot;+ cMessageExtensionService, FileChannel)
- LogState (not IsNull (ext_mgr), &quot;Extension &quot;+ cMessageExtensionService, MainFileChannel)
- SetStatus (FilterType, cEXTService, not IsNull (ext_mgr))
- if (IsNull(ext_mgr)) then
- Close #FileChannel%
- Exit Sub
- End If
-
- sCurrentMessage = cMessageExtensionInstall
- nCurrentAction = cEXTInstall
-
- &apos;Add the extension. We must provide a file URL here.
- ext_mgr.addPackage(sExtensionURL + cExtensionFileName, &quot;&quot;, obj_null, cmdEnv)
-
- &apos;Check if the extension has been added by creating a service which is contained in the extension.
- oTestExtension = createUnoService(cUnoSmoketestTestExtension)
- bResult = (oTestExtension.getImplementationName = sImplementationNameString)
- LogState (bResult, &quot;Extension &quot;+ cMessageExtensionInstall, FileChannel)
- LogState (bResult, &quot;Extension &quot;+ cMessageExtensionInstall, MainFileChannel)
- SetStatus (FilterType, cEXTInstall, bResult)
- if (not bResult) then
- Close #FileChannel%
- Exit Sub
- End If
-
- sCurrentMessage = cMessageExtensionUninstall
- nCurrentAction = cEXTUninstall
-
- &apos;Remove the package
- ext_mgr.removePackage(&quot;org.openoffice.legacy.&quot; + cExtensionFileName, cExtensionFileName, obj_null, cmdEnv)
-
- &apos;Try to create the service which is contained in the now removed extension.
- oTestExtension = createUnoService(cUnoSmoketestTestExtension)
-
- &apos;The service must not be available anymore. Therefor isNull must return true.
- LogState (IsNull (oTestExtension), &quot;Extension &quot;+ cMessageExtensionUninstall, FileChannel)
- LogState (IsNull (oTestExtension), &quot;Extension &quot;+ cMessageExtensionUninstall, MainFileChannel)
- SetStatus (FilterType, cEXTUninstall, IsNull (oTestExtension))
-
- Print #FileChannel, &quot;---&quot;
- Close #FileChannel%
- Exit Sub &apos; Without error
-
- EXTERROR:
- If (nCurrentAction = cLogfileFailed) then
- SetStatus (FilterType, cEXTService, False)
- Exit Sub
- else
- LogState (False, &quot;Extension &quot;+ sCurrentMessage, FileChannel)
- LogState (False, &quot;Extension &quot;+ sCurrentMessage, MainFileChannel)
- SetStatus (FilterType, nCurrentAction, False)
- Close #FileChannel%
- End If
- Exit Sub &apos; With error
-
-End Sub
-</script:module> \ No newline at end of file
diff --git a/smoketestoo_native/data/scripts/script.xlb b/smoketestoo_native/data/scripts/script.xlb
deleted file mode 100755
index 6b7873432f75..000000000000
--- a/smoketestoo_native/data/scripts/script.xlb
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
-<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Standard" library:readonly="false" library:passwordprotected="false">
- <library:element library:name="Global"/>
- <library:element library:name="Test_10er"/>
- <library:element library:name="Test_DB"/>
- <library:element library:name="Test_Ext"/>
-</library:library> \ No newline at end of file
diff --git a/smoketestoo_native/data/smoketestdoc.sxw b/smoketestoo_native/data/smoketestdoc.sxw
index b9139efda28d..fa67968addec 100755
--- a/smoketestoo_native/data/smoketestdoc.sxw
+++ b/smoketestoo_native/data/smoketestdoc.sxw
Binary files differ
diff --git a/smoketestoo_native/data/solaris/sparc/admin b/smoketestoo_native/data/solaris/sparc/admin
deleted file mode 100644
index 6639c2406d06..000000000000
--- a/smoketestoo_native/data/solaris/sparc/admin
+++ /dev/null
@@ -1,6 +0,0 @@
-action=nocheck
-conflict=nocheck
-setuid=nocheck
-idepend=nocheck
-mail=
-
diff --git a/smoketestoo_native/data/solaris/sparc/getuid.so b/smoketestoo_native/data/solaris/sparc/getuid.so
deleted file mode 100755
index 13c193879c4b..000000000000
--- a/smoketestoo_native/data/solaris/sparc/getuid.so
+++ /dev/null
Binary files differ
diff --git a/smoketestoo_native/data/solaris/x86/admin b/smoketestoo_native/data/solaris/x86/admin
deleted file mode 100644
index 6639c2406d06..000000000000
--- a/smoketestoo_native/data/solaris/x86/admin
+++ /dev/null
@@ -1,6 +0,0 @@
-action=nocheck
-conflict=nocheck
-setuid=nocheck
-idepend=nocheck
-mail=
-
diff --git a/smoketestoo_native/data/solaris/x86/getuid.so b/smoketestoo_native/data/solaris/x86/getuid.so
deleted file mode 100755
index c5cdc8ce7a7b..000000000000
--- a/smoketestoo_native/data/solaris/x86/getuid.so
+++ /dev/null
Binary files differ
diff --git a/smoketestoo_native/makefile.mk b/smoketestoo_native/makefile.mk
index ae7fbb01d502..8b497ddb4727 100644
--- a/smoketestoo_native/makefile.mk
+++ b/smoketestoo_native/makefile.mk
@@ -1,7 +1,6 @@
-#***********************************************************************
-#
+#*************************************************************************
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -22,33 +21,48 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
+
+PRJ = .
+PRJNAME = smoketestoo_native
+TARGET = smoketest
+
+ENABLE_EXCEPTIONS = TRUE
-PRJ=.
+.INCLUDE: settings.mk
-PRJNAME=test10
-TARGET=t1
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
-.INCLUDE : settings.mk
+SLOFILES = $(SHL1OBJS)
-STAR_REGISTRY=
-.EXPORT : STAR_REGISTRY
-.EXPORT : PERL
-.EXPORT : DMAKE_WORK_DIR
+SHL1TARGET = smoketest
+SHL1OBJS = $(SLO)/smoketest.obj
+SHL1RPATH = NONE
+SHL1STDLIBS = $(CPPUHELPERLIB) $(CPPULIB) $(CPPUNITLIB) $(SALLIB) $(TESTLIB)
+SHL1VERSIONMAP = version.map
+DEF1NAME = $(SHL1TARGET)
-.INCLUDE : target.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : make_test
+ALLTAR : cpptest
+cpptest : $(SHL1TARGETN) $(BIN)/smoketestdoc.sxw
-make_test:
-.IF $(NOREMOVE)
- @$(PERL) smoketest.pl -nr $(LAST_MINOR) $(BUILD)
-.ELSE
- @$(PERL) smoketest.pl $(LAST_MINOR) $(BUILD)
-.ENDIF
+OOO_CPPTEST_ARGS = $(SHL1TARGETN) -env:arg-doc=$(BIN)/smoketestdoc.sxw
-noremove:
- @$(PERL) smoketest.pl -nr $(LAST_MINOR) $(BUILD)
+$(BIN)/smoketestdoc.sxw: data/smoketestdoc.sxw
+ $(COPY) $< $@
+.IF "$(OS)" != "WNT"
+$(installationtest_instpath).flag : \
+ $(shell ls $(installationtest_instset)/OOo_*_install_*.tar.gz)
+ $(RM) -r $(installationtest_instpath)
+ $(MKDIRHIER) $(installationtest_instpath)
+ cd $(installationtest_instpath) && \
+ $(GNUTAR) xfz $(installationtest_instset)/OOo_*_install_*.tar.gz
+ $(MV) $(installationtest_instpath)/OOo_*_install_* \
+ $(installationtest_instpath)/opt
+ $(TOUCH) $@
+cpptest : $(installationtest_instpath).flag
+.END
diff --git a/smoketestoo_native/prj/build.lst b/smoketestoo_native/prj/build.lst
index 5a0b659bd6d1..f4bd5368c65b 100644
--- a/smoketestoo_native/prj/build.lst
+++ b/smoketestoo_native/prj/build.lst
@@ -1,4 +1,4 @@
-smtoon smoketestoo_native :: instsetoo_native NULL
+smtoon smoketestoo_native :: instsetoo_native test NULL
smtoon smoketestoo_native usr1 - all smoketestoonative_mkout NULL
smtoon smoketestoo_native\com\sun\star\comp\smoketest nmake - all smoketestoonative_csscs NULL
smtoon smoketestoo_native nmake - all,test10 smoketestoonative_mk smoketestoonative_csscs NULL
diff --git a/smoketestoo_native/smoketest.cxx b/smoketestoo_native/smoketest.cxx
new file mode 100644
index 000000000000..e2cb51127f47
--- /dev/null
+++ b/smoketestoo_native/smoketest.cxx
@@ -0,0 +1,169 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/PropertyState.hpp"
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/document/MacroExecMode.hpp"
+#include "com/sun/star/frame/DispatchResultEvent.hpp"
+#include "com/sun/star/frame/DispatchResultState.hpp"
+#include "com/sun/star/frame/XComponentLoader.hpp"
+#include "com/sun/star/frame/XController.hpp"
+#include "com/sun/star/frame/XDispatchProvider.hpp"
+#include "com/sun/star/frame/XDispatchResultListener.hpp"
+#include "com/sun/star/frame/XModel.hpp"
+#include "com/sun/star/frame/XNotifyingDispatch.hpp"
+#include "com/sun/star/lang/EventObject.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/util/URL.hpp"
+#include "cppuhelper/implbase1.hxx"
+#include "cppunit/TestAssert.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/extensions/HelperMacros.h"
+#include "cppunit/plugin/TestPlugIn.h"
+#include "osl/conditn.hxx"
+#include "osl/diagnose.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "test/getargument.hxx"
+#include "test/officeconnection.hxx"
+#include "test/oustringostreaminserter.hxx"
+#include "test/toabsolutefileurl.hxx"
+
+namespace {
+
+namespace css = com::sun::star;
+
+struct Result: private boost::noncopyable {
+ osl::Condition condition;
+ bool success;
+ rtl::OUString result;
+};
+
+class Listener:
+ public cppu::WeakImplHelper1< css::frame::XDispatchResultListener >
+{
+public:
+ Listener(Result * result): result_(result) { OSL_ASSERT(result != 0); }
+
+private:
+ virtual void SAL_CALL disposing(css::lang::EventObject const &)
+ throw (css::uno::RuntimeException) {}
+
+ virtual void SAL_CALL dispatchFinished(
+ css::frame::DispatchResultEvent const & Result)
+ throw (css::uno::RuntimeException);
+
+ Result * result_;
+};
+
+void Listener::dispatchFinished(css::frame::DispatchResultEvent const & Result)
+ throw (css::uno::RuntimeException)
+{
+ result_->success =
+ (Result.State == css::frame::DispatchResultState::SUCCESS) &&
+ (Result.Result >>= result_->result);
+ result_->condition.set();
+}
+
+class Test: public CppUnit::TestFixture {
+public:
+ virtual void setUp();
+
+ virtual void tearDown();
+
+private:
+ CPPUNIT_TEST_SUITE(Test);
+ CPPUNIT_TEST(test);
+ CPPUNIT_TEST_SUITE_END();
+
+ void test();
+
+ test::OfficeConnection connection_;
+};
+
+void Test::setUp() {
+ connection_.setUp();
+}
+
+void Test::tearDown() {
+ connection_.tearDown();
+}
+
+void Test::test() {
+ rtl::OUString doc;
+ CPPUNIT_ASSERT(
+ test::getArgument(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("doc")), &doc));
+ css::uno::Sequence< css::beans::PropertyValue > args(1);
+ args[0].Name = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode"));
+ args[0].Handle = -1;
+ args[0].Value <<=
+ com::sun::star::document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN;
+ args[0].State = css::beans::PropertyState_DIRECT_VALUE;
+ css::util::URL url;
+ url.Complete = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "vnd.sun.star.script:Standard.Global.StartTestWithDefaultOptions?"
+ "language=Basic&location=document"));
+ Result result;
+ css::uno::Reference< css::frame::XNotifyingDispatch >(
+ css::uno::Reference< css::frame::XDispatchProvider >(
+ css::uno::Reference< css::frame::XController >(
+ css::uno::Reference< css::frame::XModel >(
+ css::uno::Reference< css::frame::XComponentLoader >(
+ connection_.getFactory()->createInstance(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.frame.Desktop"))),
+ css::uno::UNO_QUERY_THROW)->loadComponentFromURL(
+ test::toAbsoluteFileUrl(doc),
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("_default")),
+ 0, args),
+ css::uno::UNO_QUERY_THROW)->getCurrentController(),
+ css::uno::UNO_SET_THROW)->getFrame(),
+ css::uno::UNO_QUERY_THROW)->queryDispatch(
+ url, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_self")), 0),
+ css::uno::UNO_QUERY_THROW)->dispatchWithNotification(
+ url, css::uno::Sequence< css::beans::PropertyValue >(),
+ new Listener(&result));
+ result.condition.wait();
+ CPPUNIT_ASSERT(result.success);
+ CPPUNIT_ASSERT_EQUAL(rtl::OUString(), result.result);
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
+
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/smoketestoo_native/smoketest.pl b/smoketestoo_native/smoketest.pl
deleted file mode 100755
index f5ef32f31bcb..000000000000
--- a/smoketestoo_native/smoketest.pl
+++ /dev/null
@@ -1,1279 +0,0 @@
-:
-eval 'exec perl -wS $0 ${1+"$@"}'
- if 0;
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-#
-# smoketest - do the smoketest
-#
-
-use lib ("$ENV{SOLARENV}/bin/modules");
-
-use File::Basename;
-use File::Path;
-use File::Copy;
-use Getopt::Long;
-use SourceConfig;
-
-########################
-# #
-# Globale Variablen #
-# #
-#########################
-$is_debug = 0; # run without executing commands
-$is_command_infos = 0; # print command details before exec
-$is_protocol_test = 0;
-$is_remove_on_error = 0;
-$is_remove_at_end = 1;
-$is_do_deinstall = 0;
-$is_without_msiexec = 1;
-$is_oo = 1;
-
-$sourceconfig_obj;
-$gui = $ENV{GUI};
-$temp_path = $ENV{TEMP};
-$vcsid = $ENV{VCSID};
-$sversion_saved = 0;
-$FileURLPrefix = "file:///";
-$userinstalldir = "UserInstallation";
-$cygwin = "cygwin";
-$prefered_lang = "en-US";
-$global_instset_mask = "";
-$smoketest_install = $ENV{SMOKETESTINSTALLSET};
-
-if (!defined($gui)) {
- print "The workstamp is missing. Please use setsolar\n";
- exit(1);
-}
-
-if (($gui eq "WNT") and ($ENV{USE_SHELL} ne "4nt")) {
- $gui = $cygwin;
-}
-
-if (!defined($temp_path) and (($gui eq "UNX") or ($gui eq $cygwin))) {
- $temp_path = $ENV{TMPDIR};
- if (!defined($temp_path) and (-d "/tmp")) {
- $temp_path = "/tmp";
- }
-}
-
-if (defined($ENV{INSTALLPATH_SMOKETEST})) {
- $installpath_without = $ENV{INSTALLPATH_SMOKETEST};
-}
-else {
- $installpath_without = $temp_path;
-}
-
-if (!defined($installpath_without)) {
- print "Your temp value is missing. Please set your temp-variable or define INSTALLPATH_SMOKETEST\n\n";
- exit(1);
-}
-
-if (!((defined($ENV{UPDATER})) and ($ENV{UPDATER} eq "YES") and !defined($ENV{CWS_WORK_STAMP})) ) {
- $is_protocol_test = 0;
-}
-
-if ($gui eq "WNT") {
- $PathSeparator = '\\';
- $NewPathSeparator = ';';
- $dos = "$ENV{COMSPEC} -c";
- $PERL = "$dos $ENV{PERL}";
- $REMOVE_DIR = "$dos del /qsxyz";
- $REMOVE_FILE = "$dos del";
- $LIST_DIR = "$dos ls";
- $COPY_FILE = "$dos copy";
- $COPY_DIR = "$dos copy /s";
- $MK_DIR = "md";
- $RENAME_FILE = "ren";
- $nul = '> NUL';
- $RESPFILE="response_fat_wnt";
- $SVERSION_INI = $ENV{USERPROFILE} . $PathSeparator . "Anwendungsdaten" . $PathSeparator . "sversion.ini";
- $SOFFICEBIN = "soffice.exe";
- $bootstrapini = "bootstrap.ini";
- $bootstrapiniTemp = $bootstrapini . "_";
- $packpackage = "msi";
- $installpath_without =~ s/\//\\/g;
-}
-elsif ($gui eq "UNX") {
- $is_do_deinstall = 0;
- $PathSeparator = '/';
- $NewPathSeparator = ':';
- $dos = "";
- $PERL = "$ENV{PERL}";
- $REMOVE_DIR = "rm -rf";
- $REMOVE_FILE = "rm -f";
- $LIST_DIR = "ls";
- $COPY_FILE = "cp -f";
- $MK_DIR = "mkdir";
- $RENAME_FILE = "mv";
- $nul = '> /dev/null';
- $RESPFILE="response_fat_unx";
- $SVERSION_INI = $ENV{HOME} . $PathSeparator . ".sversionrc";
- $bootstrapini = "bootstraprc";
- $bootstrapiniTemp = $bootstrapini . "_";
- $packpackage = $ENV{PKGFORMAT};
- $SOFFICEBIN = "soffice";
- if ($ENV{OS} eq "MACOSX") {
- $COPY_DIR = "cp -RPfp";
- }
- else {
- $COPY_DIR = "cp -rf";
- }
-}
-elsif ($gui eq $cygwin) {
- $PathSeparator = '/';
- $NewPathSeparator = ':';
- $dos = "";
- $PERL = "$ENV{PERL}";
- $REMOVE_DIR = "rm -rf";
- $REMOVE_FILE = "rm -f";
- $LIST_DIR = "ls";
- $COPY_FILE = "cp -f";
- $COPY_DIR = "cp -rf";
- $MK_DIR = "mkdir";
- $RENAME_FILE = "mv";
- $nul = '> /dev/null';
- $RESPFILE="response_fat_wnt";
- $SVERSION_INI = $ENV{USERPROFILE} . $PathSeparator . "Anwendungsdaten" . $PathSeparator . "sversion.ini";
- $SOFFICEBIN = "soffice";
- $bootstrapini = "bootstrap.ini";
- $bootstrapiniTemp = $bootstrapini . "_";
- $CygwinLineends = $/;
- $WinLineends = "\r\n";
- $packpackage = "msi";
- $installpath_without =~ s/\\/\//g;
-}
-else {
- print_error ("not supported system\n",1);
-}
-
-if ($is_without_msiexec) {
- require installer::windows::admin; import installer::windows::admin;
- $installer::globals::logfilename = $ENV{DMAKE_WORK_DIR} . $PathSeparator . $ENV{OUTPATH} . $ENV{PROEXT} . $PathSeparator . "misc" . $PathSeparator . "installer.log";
- $installer::globals::exithandler = \&install_error;
-}
-
-if ($is_oo) {
- @install_list = ( 'instsetoo_native'
- );
-}
-else {
- @install_list = ( 'instset_native'
- );
-}
-
-@error_messages = ( '',
- 'lock flag for pkgadd still exist. Installation not possible!',
- 'Error during installation!',
- 'Error: patching configuration failed!',
- 'Error: starting office failed or office crashed!',
- 'Error during testing',
- 'can not copy extension',
- 'Error in setup log',
- 'installationsset is not complete',
- 'can not copy all basic scripts',
- 'can not patch bottstrapini',
- 'msiexec failed. Maybe you have got an installed version',
- 'deinstallation is incomplete',
- 'this packformat is not supported for this environment',
- 'can not set execute permission'
-);
-
-my $show_NoMessage = 0;
-my $show_Message = 1;
-
-my $error_logflag = 1;
-my $error_setup = 2;
-my $error_patchConfig = 3;
-my $error_startOffice = 4;
-my $error_testResult = 5;
-my $error_copyExtension = 6;
-my $error_setup_log = 7;
-my $error_installset = 8;
-my $error_copyBasic = 9;
-my $error_patchBootstrap = 10;
-my $error_msiexec = 11;
-my $error_deinst = 12;
-my $error_packformat = 13;
-my $error_permission = 14;
-
-my $command_normal = 0;
-my $command_withoutErrorcheck = 1;
-my $command_withoutOutput = 2;
-
-if ($is_oo) {
- $PRODUCT="OpenOffice";
-}
-else {
- $PRODUCT="StarOffice";
-}
-
-if (($ENV{PKGFORMAT} eq "installed") and (!defined ($ENV{FORCE2ARCHIVE}))) {
- $packpackage = $ENV{PKGFORMAT}; # take it for all environments
-}
-elsif (defined ($ENV{FORCE2ARCHIVE})) {
- $packpackage = "archive"; # take it for all environments
-}
-$StandDir = $ENV{SOLARSRC} . $PathSeparator;
-$SHIP = defined $ENV{SHIPDRIVE} ? $ENV{SHIPDRIVE} . $PathSeparator : "shipdrive_not_set";
-$PORDUCT = "$SHIP$ENV{INPATH}$PathSeparator$PRODUCT$PathSeparator$packpackage$PathSeparator";
-$DATA="$ENV{DMAKE_WORK_DIR}$PathSeparator" . "data$PathSeparator";
-$WORK_STAMP_LC=$ENV{WORK_STAMP};
-$WORK_STAMP_LC =~ tr/A-Z/a-z/;
-$ENV{DBGSV_INIT} = $DATA . "dbgsv.ini";
-$ExtensionDir = $ENV{DMAKE_WORK_DIR} . $PathSeparator . $ENV{OUTPATH} . $ENV{PROEXT} . $PathSeparator . "bin" . $PathSeparator;
-
-if (defined($vcsid)) {
- $installpath_without .= $PathSeparator . $vcsid;
-}
-if (!$is_oo) {
- $installpath_without .= $PathSeparator . "StarOffice";
-}
-else {
- $installpath_without .= $PathSeparator . "OpenOffice";
-}
-
-$installpath = $installpath_without . $PathSeparator;
-$installpath = glob $installpath;
-
-$ENV{STAR_REGISTRY}="";
-$milestone = "";
-
-#### options ####
-
-$opt_nr = 0;
-GetOptions('nr');
-
-if ($opt_nr) {
- $is_remove_at_end = 0; # do not remove installation
-}
-if ( $ARGV[0] ) {
- $milestone = $ARGV[0];
-}
-if ( $ARGV[1] ) {
- $buildid = $ARGV[1];
-}
-
-
-#### script id #####
-
-( $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
-
-$id_str = ' $Revision: 1.35 $ ';
-$id_str =~ /Revision:\s+(\S+)\s+\$/
- ? ($script_rev = $1) : ($script_rev = "-");
-
-print "$script_name -- version: $script_rev\n";
-
-
-#### main ####
-
-if (!$is_debug) {
- if ($is_do_deinstall) {
- deinstallInstallation ($installpath);
- }
- removeOldInstallation($installpath);
- save_sversion ($SVERSION_INI);
-}
-
-($INSTSETNAME, $INSTALLSET) = getInstset();
-
-print "Install: $INSTALLSET$INSTSETNAME\n";
-prepare();
-doTest();
-
-if (!$is_debug) {
- restore_sversion ($SVERSION_INI);
- if ($is_remove_at_end) {
- if ($is_do_deinstall) {
- deinstallInstallation ($installpath);
- }
- removeInstallation($installpath);
- }
- else {
- print_notRemoved ($installpath);
- }
-}
-print "smoketest successful!\n";
-exit (0);
-
-#########################
-# #
-# Procedures #
-# #
-#########################
-
-sub getSubFiles {
- my ($startDir, $DirArray_ref, $mask) = @_;
- my ($dir);
- opendir(DIR,"$startDir");
- while($dir = readdir(DIR)) {
- if (($dir =~ /\.$/) or ($dir !~ /$mask/)) {
- next;
- }
- push (@{$DirArray_ref}, "$dir");
- }
- closedir(DIR);
-
-}
-
-sub getSubDirs {
- my ($startDir, $DirArray_ref) = @_;
- my ($dir);
- opendir(DIR,"$startDir");
- while($dir = readdir(DIR)) {
- if (($dir !~ /\.$/) and ( -d "$startDir$dir") ) {
- push (@{$DirArray_ref}, "$dir");
- }
- }
- closedir(DIR);
-
-}
-
-sub getSubDirsFullPath {
- my ($startDir, $DirArray_ref) = @_;
- my ($dir);
- opendir(DIR,"$startDir");
- while($dir = readdir(DIR)) {
- if (($dir !~ /\.$/) and ( -d "$startDir$dir") ) {
- push (@{$DirArray_ref}, "$startDir$dir");
- }
- }
- closedir(DIR);
-
-}
-
-sub findSubDir {
- my ($DirArray_ref) = @_;
- my (@sortedArray, $dir, $instdir);
- @sortedArray = sort langsort @{$DirArray_ref};
- print "Langs: @sortedArray\n" if $is_command_infos;
- foreach $dir (@sortedArray) {
- if ($dir =~ /log$/) {
- next;
- }
- $instdir = "$dir";
- return $instdir;
- }
- return "";
-}
-
-sub findMultiple {
- my ($base, $name) = @_;
- my ($f, @s, @res);
- opendir(DIR, $base) or die "cannot open dir $base";
- while ($f = readdir(DIR)) {
- push @res, "$base" if $f eq $name;
- push @s, $f if
- -d "$base$f" && ! -l "$base$f" && $f ne '.' && $f ne '..';
- }
- closedir(DIR);
- foreach $f (@s) {
- push @res, findMultiple("$base$f$PathSeparator", $name);
- }
- return @res;
-}
-
-sub findUnique {
- my ($base, $name) = @_;
- my @res = findMultiple($base, $name);
- die "no unique $name in $base" unless @res == 1;
- return $res[0];
-}
-
-sub prepare {
- if ($gui eq "UNX") {
- $ENV{ignore_patch_check}="t";
- $ENV{OOO_FORCE_DESKTOP} = "none";
- }
-
-}
-
-sub is_Installset_ok {
- my ($installpath, $installname) = @_;
- my ($is_ok, $infile);
- $is_ok = 1;
- $infile = $INSTALLSET. "log$PathSeparator";
- $infile =~ s/_pre_//;
- $infile =~ s/[\/\\]normal[\/\\]//;
- $infile =~ s/\.(\d+)$/_$1\.html/;
- #if ($installname =~ /(?:_pre_){0,1}(.*)\.(\d+)/) {
- # $infile .= "$1_$2.html";
- # print "protocol: $infile\n" if $is_debug;
- #}
- open INTABLE, "<$infile" or return errorFromOpen ($infile);
- while(<INTABLE>) {
- $line = $_;
- if ( $line =~ />(error)(.*)</ ) {
- print "ERROR: $1$2\n";
- $is_ok = 0;
- }
- }
- close INTABLE;
- return $is_ok;
-}
-
-sub errorFromOpen {
- my ($file) = @_;
- print "ERROR: can't open $file\n";
- return 0;
-}
-
-sub doTest {
- my ($Command);
- my (@Params, $basedir, $basisdir, $branddir);
-
- # check installset (error 8)
-
- if (($INSTSETNAME ne "") and $is_protocol_test) {
- if (!is_Installset_ok ("$PORDUCT", $INSTSETNAME)) {
- print_error ($error_messages[$error_installset], $error_installset);
- }
- }
-
- # install office (error 2)
-
- $basedir = doInstall ("$INSTALLSET$INSTSETNAME$PathSeparator", $installpath);
- $basisdir = findUnique($basedir, 'ure-link');
- $branddir = findUnique($basedir, 'basis-link');
- if ( (defined($ENV{OS})) && ($ENV{OS} eq "MACOSX") ) {
- $programpath = "$branddir". "MacOS$PathSeparator";
- }
- else {
- $programpath = "$branddir". "program$PathSeparator";
- }
- $userinstallpath_without = $installpath . $userinstalldir;
- $userinstallpath = $userinstallpath_without . $PathSeparator;
- $userpath = "$userinstallpath" . "user$PathSeparator";
- $basicpath = $userpath . "basic$PathSeparator";
- $standardbasicpath = "$basisdir" . "presets$PathSeparator" . "basic$PathSeparator";
- $LOGPATH="$userinstallpath" . "user" . $PathSeparator . "temp";
-
- if ($gui eq "UNX") {
- $Command = "chmod -R 777 \"$basedir\"*";
- execute_system ("$Command");
- }
-
- # check setup log file (error 7)
-
-# $Command = "$PERL check_setup.pl \"$programpath" . "setup.log\"";
-# execute_Command ($Command, $error_setup_log, $show_Message, $command_normal );
-
- # patch config (error 3)
-
- $Command = "$PERL config.pl \"$branddir\" \"$userinstallpath\" \"$buildid\"";
- execute_Command ($Command, $error_patchConfig, $show_Message, $command_normal );
-
- # copy basicscripts (error 9)
-
- $Command = "$COPY_FILE \"$DATA" . "scripts$PathSeparator" . "\"*.x* \"$standardbasicpath" . "Standard$PathSeparator\"";
- execute_Command ($Command, $error_copyBasic, $show_Message, $command_withoutOutput);
-
- createPath("$basicpath", $error_copyBasic);
- $Command = "$COPY_DIR \"$standardbasicpath\"* \"$basicpath\"";
- execute_Command ($Command, $error_copyBasic, $show_Message, $command_withoutOutput);
-
- # patching bootstrap (error 11)
-
- if (!patch_bootstrap ("$programpath$bootstrapini", "$programpath$bootstrapiniTemp")) {
- print_error ($error_messages[$error_patchBootstrap], $error_patchBootstrap);
- }
-
- # copy extension (error 6)
-
- createPath ($LOGPATH, $error_copyExtension);
- $Command = "$COPY_FILE \"$ExtensionDir" . "TestExtension.oxt\" " . "\"$LOGPATH$PathSeparator\"";
- execute_Command ($Command, $error_copyExtension, $show_Message, $command_withoutOutput);
-
-
- # start office (error 4)
-
- print "starting office ($INSTSETNAME)\n";
-
- $Command = "\"$programpath" . "$SOFFICEBIN\" -norestore -nocrashreport macro:///Standard.Global.StartTestWithDefaultOptions";
- if ( (defined($ENV{OS})) && ($ENV{OS} eq "MACOSX") ) {
- $Command = "cd \"$programpath\"; " . $Command;
- }
- execute_Command ($Command, $error_startOffice, $show_Message, $command_normal);
-
- # test if smoketest is ok (error 5)
-
- $Command = "$PERL testlog.pl \"$LOGPATH\"";
- execute_Command ($Command, $error_testResult, $show_Message, $command_normal);
-
- # deinstall office (error 6)
-
- if ($is_remove_at_end) {
- print "Deinstalling Office\n";
- }
-# $Command = "$PERL deinstall.pl \"$LOGPATH\" \"$installpath\"";
-# execute_Command ($Command, $error_deinstall, $show_NoMessage, $command_normal);
-}
-
-sub install_error {
- print_error ($error_messages[$error_setup], $error_setup);
-}
-
-sub doInstall {
- my ($installsetpath, $dest_installdir) = @_;
- my ($DirArray, $mask, $file, $Command, $optdir, $rpmdir, $system, $mach, $basedir, $output_ref, $olddir, $newdir);
- if (($ENV{PKGFORMAT} eq "installed") and (!defined($ENV{FORCE2ARCHIVE}))) {
- createPath ($dest_installdir, $error_setup);
- $Command = "$COPY_DIR \"$installsetpath\" \"$dest_installdir\"";
- execute_Command ($Command, $error_setup, $show_Message, $command_withoutOutput);
- @DirArray = ();
- getSubDirsFullPath ($dest_installdir, \@DirArray);
- if ($#DirArray == 0) {
- $basedir = $DirArray[0] . $PathSeparator;
- }
- elsif ($#DirArray == -1) {
- print_error ($error_setup, $show_Message);
- }
- else {
- $basedir = $dest_installdir;
- }
- }
- elsif (($gui eq "WNT") or ($gui eq $cygwin)) {
- if (defined($ENV{FORCE2ARCHIVE})) {
- print_error ($error_messages[$error_packformat], $error_packformat);
- }
- $mask = "\\.msi\$";
- getSubFiles ("$installsetpath", \@DirArray, $mask);
- if ($#DirArray == -1) {
- print_error ("Installationset in $installsetpath is incomplete", 2);
- }
- foreach $file (@DirArray) {
- if ($is_without_msiexec) {
- if ($is_debug) {
- print "Debugmode: no installation from $installsetpath\n";
- }
- else {
- createPath ($dest_installdir, $error_setup);
- installer::windows::admin::make_admin_install ($installsetpath . $file, $dest_installdir);
- if ($gui eq $cygwin) {
- $Command = "find $dest_installdir \\( -name \"installhelper\" -prune -o -name \"*.exe\" -o -name \"*.dll\" -o -name \"*.manifest\" -o -name \"*.bin\" -o -name \"*.jar\" \\) -exec chmod a+x {} \\;";
- execute_Command ($Command, $error_permission, $show_Message, $command_normal);
- }
- }
- }
- else
- {
- if ($gui eq $cygwin) {
- my $convertinstallset = ConvertCygwinToWin_Shell("$installsetpath$file");
- my $convertdestdir = ConvertCygwinToWin_Shell($dest_installdir);
- $_inst_cmd=$ENV{SMOKETEST_SOINSTCMD};
- if ( defined($_inst_cmd) ) {
- $Command = $_inst_cmd . " $convertinstallset -qn TARGETDIR=$convertdestdir";
- }
- else {
- $Command = "msiexec.exe /a $convertinstallset -qn TARGETDIR=$convertdestdir ALLUSERS=2";
- }
- }
- else {
- $_inst_cmd=$ENV{SMOKETEST_SOINSTCMD};
- if ( defined($_inst_cmd) ) {
- $Command = $_inst_cmd . " $installsetpath$file -qn TARGETDIR=$dest_installdir";
- }
- else {
- $Command = "msiexec.exe /a $installsetpath$file -qn TARGETDIR=$dest_installdir ALLUSERS=2";
- }
- }
- execute_Command ($Command, $error_msiexec, $show_Message, $command_normal);
- }
- }
- $basedir = $dest_installdir;
- }
- elsif ($gui eq "UNX") {
- $system = `uname -s`;
- chomp $system;
- $mach = `uname -m`;
- chomp $mach;
- if (defined ($ENV{EPM}) && ($ENV{EPM} eq 'NO')) { # do the install ourselves ...
-# FIXME - this tool should work nicely without such hacks
-# cut/paste from ooo-build/bin/ooinstall
- my $instoo_dir = "$ENV{SRC_ROOT}/instsetoo_native";
-
- if ( $ENV{'SYSTEM_MOZILLA'} eq 'YES' ) {
- if (defined $ENV{'LD_LIBRARY_PATH'}) {
- $ENV{'LD_LIBRARY_PATH'} =
- "$ENV{'LD_LIBRARY_PATH'}:$ENV{'MOZ_LIB'}";
- } else {
- $ENV{'LD_LIBRARY_PATH'} = $ENV{'MOZ_LIB'};
- }
- }
- $ENV{'PYTHONPATH'} = "$ENV{SRC_ROOT}/instsetoo_native/$ENV{INPATH}/bin:$ENV{SOLARVERSION}/$ENV{INPATH}/lib";
- $ENV{OUT} = "../$ENV{INPATH}";
- $ENV{LOCAL_OUT} = "../$ENV{INPATH}";
- $ENV{LOCAL_COMMON_OUT} = "../$ENV{INPATH}";
- my $sane_destdir = $dest_installdir;
- $sane_destdir .= "oootest";
- createPath ($sane_destdir, $error_setup);
- $Command = "cd $instoo_dir/util ; perl -w $ENV{SOLARENV}/bin/make_installer.pl " .
- "-f openoffice.lst -l en-US -p OpenOffice " .
- "-buildid \"smoketestoo\" -simple $sane_destdir";
-# FIXME - this tool should work nicely without such evil
- execute_Command ($Command, $error_setup, $show_Message, $command_normal);
- return "$sane_destdir/"
-
- } elsif ( (defined($system)) && ($system eq "Linux") ) {
- if (defined ($ENV{FORCE2ARCHIVE}) and ($ENV{FORCE2ARCHIVE} eq "TRUE")) {
- $optdir = $dest_installdir; #needed for getting work dir at the end
- $mask = "\\.tar\\.gz\$";
- getSubFiles ("$installsetpath", \@DirArray, $mask);
- if ($#DirArray == -1) {
- print_error ("Installationset in $installsetpath is incomplete", 2);
- }
- elsif ($#DirArray == 0) {
- createPath ($dest_installdir, $error_setup);
- $Command = "cd \"$dest_installdir\" && tar xzvf \"$installsetpath$DirArray[0]\"";
- execute_Command ($Command, $error_setup, $show_Message, $command_withoutOutput);
- }
- else {
- print_error ($error_setup, $show_Message);
- }
- }
- elsif ($ENV{PKGFORMAT} eq "deb") { # default is rpm
- $installsetpath .= "DEBS$PathSeparator";
- $optdir = "$dest_installdir" . "opt" . $PathSeparator;
- createPath ($optdir, $error_setup);
- $mask = "\\.deb\$";
- getSubFiles ("$installsetpath", \@DirArray, $mask);
- if ($#DirArray == -1) {
- print_error ("Installationset in $installsetpath is incomplete", 2);
- }
- foreach $file (@DirArray) {
- if ( ($file =~ /-menus-/) or ($file =~ /^adabas/) or (/^j2re-/) or ($file =~ /-gnome-/) ) {
- next;
- }
- $Command = "dpkg-deb -x $installsetpath$file $dest_installdir";
- execute_Command ($Command, $error_setup, $show_Message, $command_withoutErrorcheck | $command_withoutOutput);
- }
- }
- else {
- $installsetpath .= "RPMS$PathSeparator";
- $optdir = "$dest_installdir" . "opt" . $PathSeparator;
- $rpmdir = "$dest_installdir" . "rpm" . $PathSeparator;
- createPath ($optdir, $error_setup);
- createPath ($rpmdir, $error_setup);
- my $ld_library_backup = $ENV{LD_LIBRARY_PATH};
- if ( defined $ENV{SYSBASE}) {
- my $sysbase=$ENV{SYSBASE};
- if ( "$ld_library_backup" eq "" ) {
- $ENV{LD_LIBRARY_PATH} = "$sysbase/usr/lib";
- } else {
- $ENV{LD_LIBRARY_PATH} = "$ld_library_backup:$sysbase/lib";
- }
- }
- $Command = "rpm --initdb --define \"_dbpath $rpmdir\"";
- execute_Command ($Command, $error_setup, $show_Message, $command_withoutOutput);
- $mask = "\\.rpm\$";
- getSubFiles ("$installsetpath", \@DirArray, $mask);
- if ($#DirArray == -1) {
- print_error ("Installationset in $installsetpath is incomplete", 2);
- }
- foreach $file (@DirArray) {
- if ( ($file =~ /-menus-/) or ($file =~ /^adabas/) or (/^j2re-/) or ($file =~ /-gnome-/) ) {
- next;
- }
- $Command = "rpm ";
- $Command .= "--ignorearch " if (defined $ENV{HOSTTYPE} && ($ENV{HOSTTYPE} eq 'x86_64-linux'));
- $Command .= "--define \"_dbpath $rpmdir\" --install --ignoresize --nodeps -vh --relocate /opt=${dest_installdir}opt $installsetpath$file";
- execute_Command ($Command, $error_setup, $show_Message, $command_withoutErrorcheck | $command_withoutOutput);
- }
- $ENV{LD_LIBRARY_PATH}=$ld_library_backup;
- }
- }
- elsif ( (defined($system)) && ($system eq "SunOS") ) {
- if (defined($ENV{FORCE2ARCHIVE})) {
- print_error ($error_messages[$error_packformat], $error_packformat);
- }
- @DirArray = ();
- $mask = "^.ai.pkg.zone.lock";
- getSubFiles ("/tmp", \@DirArray, $mask);
- if ($#DirArray >= 0) {
- foreach $file (@DirArray) {
- $Command = "$REMOVE_FILE /tmp/$file";
- execute_Command ($Command, $error_logflag, $show_Message, $command_withoutOutput);
- }
- }
- if ($mach eq sun4u) {
- $solarisdata = $DATA . "solaris$PathSeparator" . "sparc$PathSeparator";
- }
- else {
- $solarisdata = $DATA . "solaris$PathSeparator" . "x86$PathSeparator";
- }
- $installsetpath .= "packages$PathSeparator";
- $optdir = "$dest_installdir" . "opt" . $PathSeparator;
- createPath ($optdir, $error_setup);
- createPath ($dest_installdir . "usr$PathSeparator" . "bin", $error_setup);
- @DirArray = ();
- getSubDirs ("$installsetpath", \@DirArray);
- my $ld_preload = $ENV{LD_PRELOAD};
- $ENV{LD_PRELOAD} = $solarisdata . "getuid.so";
- if ($#DirArray == -1) {
- print_error ("Installationset in $installsetpath is incomplete", 2);
- }
- foreach $file (@DirArray) {
- if ( ($file =~ /-gnome/) or ($file =~ /-cde/) or ($file =~ /adabas/) or ($file =~ /j3/) or ($file =~ /-desktop-/) ) {
- next;
- }
- $Command = "pkgparam -d $installsetpath $file BASEDIR";
- $output_ref = execute_Command ($Command, $error_setup, $show_Message, $command_withoutOutput);
- if (($#{@$output_ref} > -1) and ($$output_ref[0] ne "") ) {
- createPath ("$dest_installdir$$output_ref[0]", $error_setup);
- }
- $Command = "pkgadd -a $solarisdata" . "admin -d $installsetpath -R $dest_installdir $file";
- execute_Command ($Command, $error_setup, $show_Message, $command_withoutErrorcheck | $command_withoutOutput);
- }
- my $pkgadd_tmpfile = "/tmp/.ai.pkg.zone.lock*";
- $Command = "$REMOVE_FILE $pkgadd_tmpfile";
- execute_Command ($Command, $error_setup, $show_NoMessage, $command_withoutErrorcheck | $command_withoutOutput);
- $ENV{LD_PRELOAD} = $ld_preload;
- }
- elsif ( (defined($ENV{OS})) && ($ENV{OS} eq "MACOSX") ) {
- if (defined($ENV{FORCE2ARCHIVE})) {
- print_error ($error_messages[$error_packformat], $error_packformat);
- }
- @DirArray = ();
- my $install_dmg;
- getSubFiles ("$installsetpath", \@DirArray, "^[a-zA-Z0-9].*\\.dmg\$");
- if ($#DirArray == 0) {
- $install_dmg = "$installsetpath" . $DirArray[0];
- }
- elsif ($#DirArray > 0) {
- print_error ("more than one installset found in $installsetpath", 2);
- }
- else {
- print_error ("no installset found in $installsetpath", 2);
- }
- $Command = "hdiutil attach " . $install_dmg;
- my $output_ref;
- $output_ref = execute_Command ($Command, $error_setup, $show_Message, $command_withoutOutput);
- my $volumeinfo = $$output_ref[$#{@{$output_ref}}];
- if (!$volumeinfo =~ /OpenOffice/) {
- print_error ("mount of $install_dmg failed", 2);
- }
- $volumeinfo =~ s/\s{2,}/;/g;
- my @volumeinfos = split(/;/,$volumeinfo);
- my $detachpath = $volumeinfos[0];
- my $newinstallsetpath = $volumeinfos[2] . $PathSeparator;
- createPath ($dest_installdir, $error_setup);
- $Command = "$COPY_DIR \"$newinstallsetpath\" \"$dest_installdir\"";
- execute_Command ($Command, $error_setup, $show_Message, $command_withoutOutput);
- $Command = "hdiutil detach " . $detachpath;
- execute_Command ($Command, $error_setup, $show_Message, $command_withoutOutput);
- @DirArray = ();
- getSubFiles ("$dest_installdir", \@DirArray, "\\.app");
- if ($#DirArray == 0) {
- $optdir = "$dest_installdir" . $DirArray[0] . $PathSeparator;
- my $PListFile = "Info.plist";
- my $officeDir = "$optdir" . "Contents" . $PathSeparator;
- my $programmDir = "$officeDir" . "MacOS" . $PathSeparator;
- $Command = "$COPY_FILE \"$officeDir$PListFile\" \"$programmDir$PListFile\"";
- execute_Command ($Command, $error_setup, $show_Message, $command_withoutOutput);
- }
- else {
- print_error ("Installation in $dest_installdir is incomplete", 2);
- }
- }
- else {
- print_error ("Plattform is not supported", 2);
- }
- @DirArray = ();
- getSubDirsFullPath ($optdir, \@DirArray);
- if ($#DirArray == 0) {
- $basedir = $DirArray[0] . $PathSeparator;
- }
- elsif ($#DirArray == -1) {
- print_error ($error_setup, $show_Message);
- }
- else {
- $basedir = $optdir;
- }
- }
- return ($basedir);
-}
-
-sub langsort {
- if ($a eq $prefered_lang) {
- return -1;
- }
- elsif ($b eq $prefered_lang) {
- return 1;
- }
- else {
- $a cmp $b;
- }
-}
-
-sub getInstset {
- my ($INSTSET, $NEWINSTSET);
- my (@DirArray, $InstDir, $RootDir, $TestDir1, $TestDir2);
-
- if (defined ($ENV{EPM}) && ($ENV{EPM} eq 'NO') && ($gui eq "UNX")) { # we do the install ourselves ...
- return ();
- }
-
- print "get Instset\n" if $is_debug;
- $NEWINSTSET = "";
- if (defined($smoketest_install)) {
- my $mask = "\\" . $PathSeparator . "\$";
- $smoketest_install =~ s/$mask//;
- my ($sufix);
- ($NEWINSTSET, $INSTSET, $sufix) = fileparse ($smoketest_install);
- return ($NEWINSTSET, $INSTSET);
- }
- if (!isLocalEnv() and !defined($ENV{CWS_WORK_STAMP}) and (-e $SHIP)) {
- ($NEWINSTSET, $INSTSET) = getSetFromServer();
- }
- else {
- $InstDir="";
- $RootDir=$ENV{DMAKE_WORK_DIR};
- $RootDir=~s/\w+$//;
- foreach $project (@install_list) {
- @DirArray=();
- $TestDir1 = "$RootDir$project$PathSeparator$ENV{INPATH}$PathSeparator$PRODUCT$PathSeparator$packpackage$PathSeparator" . "install$PathSeparator";
- if (-e "$TestDir1") {
- $InstDir= $TestDir1;
- }
- else {
- $sourceconfig_obj = SourceConfig->new() if (!defined ($sourceconfig_obj));
- my $module_path = $sourceconfig_obj->get_module_path($project);
- # only if module exists
- if (defined ($module_path)) {
- $TestDir2 = "$module_path$PathSeparator$ENV{INPATH}$PathSeparator$PRODUCT$PathSeparator$packpackage$PathSeparator" . "install$PathSeparator";
- }
- else {
- $TestDir2 = $module_path;
- }
- if (defined ($TestDir2) && -e "$TestDir2") {
- $InstDir="$TestDir2";
- }
- }
- if ($InstDir eq "") {
- next;
- }
- getSubDirs ("$InstDir", \@DirArray);
- $INSTSET = findSubDir (\@DirArray);
- print "Lang-Sel: $INSTSET\n" if $is_command_infos;
-;
- if ($INSTSET ne "") {
- $NEWINSTSET = $INSTSET;
- $INSTSET = $InstDir;
- print "new: $INSTSET\n";
- }
- if (($INSTSET ne "") and (-e $INSTSET)) {
- return ($NEWINSTSET, $INSTSET);
- }
- }
- print_error ("no installationset found\n",2);
- }
- return ($NEWINSTSET, $INSTSET);
-}
-
-sub isLocalEnv {
- my $returnvalue = 0;
- if (defined ($ENV{SOL_TMP}) && defined ($ENV{SOLARVERSION})) {
- my $mask = $ENV{SOL_TMP};
- $mask =~ s/\\/\\\\/;
- print "Mask: $mask\n" if $is_debug;
- if ($ENV{SOLARVERSION}=~ /$mask/) {
- $returnvalue = 1;
- }
- }
- return $returnvalue;
-}
-
-sub get_productcode {
- my ( $installpath ) = @_;
- my ($path, $productcode);
- $productcode = "";
- $path = "$installpath" . "setup.ini";
- print "$path\n" if $is_debug;
- if ( !open(SETUP,$path) ) {
- print "FATAL: can't open $path\n" if ($is_command_infos);
- return ($productcode);
- }
-
- if (!eof(SETUP)) {
- while (<SETUP>) {
- chomp;
- if ( /productcode=(\{[\d\w-]+\})/ ) {
- $productcode = $1;
- }
- }
-
- close(SETUP);
- }
- return ($productcode);
-}
-
-sub InstsetSort {
- my ($a1, $b1);
- if ($a =~ /$global_instset_mask/) {
- $a1 = $1;
- }
- if ($b =~ /$global_instset_mask/) {
- $b1 = $1;
- }
- $a1 <=> $b1;
-}
-
-sub getSetFromServer {
- my ($DirName, $SetupFullPath);
- my $workspace = $ENV{WORK_STAMP};
- my $platform = $ENV{INPATH};
- my $latestset;
- my (@DirArray, $mask);
- $SetupFullPath = $PORDUCT;
- if ( ! ( $workspace && $platform ) ) {
- print_error ( "Error: environment not set correctly.", 1);
- }
- if (!defined($milestone)) {
- print_error ("Milestone ist not defined!", 2);
- }
- if (!defined($buildid)) {
- print_error ("Build-ID ist not defined!", 2);
- }
-
-# if ( $SetupFullPath =~ /^\/s.*\/install\// ) {
-# if ( $gui eq "UNX" ) {
-# $SetupFullPath = "/net/jumbo.germany" . $SetupFullPath;
-# } else {
-# $SetupFullPath = "\\\\jumbo" . $SetupFullPath;
-# }
-# }
-
-# my $ws_lc = lc $workspace;
- $mask = "^$workspace" . "_" . $milestone . "_native_packed-(\\d+)_en-US\\.$buildid";
- $global_instset_mask = $mask;
- getSubFiles ($SetupFullPath, \@DirArray, $mask);
- @DirArray = sort InstsetSort @DirArray;
- if ($#DirArray > -1) {
- $latestset = $DirArray [$#DirArray];
- $DirName = $latestset;
- }
- else {
- print_error ("Cannot find install set $SetupFullPath for $workspace $milestone", 2);
- }
- print "Latest install sets: $latestset\n" if $is_debug;
-
- print "$DirName\t $SetupFullPath\n" if $is_debug;
-
- # compare with file system
- # at the moment just the existence is checked. For security reasons it might be
- # better to additionally check whether there are newer sets (this must not happen,
- # but who knows ...)
- if ( -d $SetupFullPath ) {
- return ($DirName, $SetupFullPath);
- } else {
- print_error ("Cannot find install set $SetupFullPath for $workspace $milestone", 2);
- }
-}
-
-sub patch_bootstrap {
- my ($sourcefile, $destfile) = @_;
- my (@convert_split, $line);
- my ($Error) = 1;
- my ($lineend);
-
- if ($is_debug) {
- print "patching bootstrap $sourcefile ...\n";
- return 1;
- }
-
- $Error &= move ("$sourcefile", "$destfile");
-
- open OUTFILE, ">$sourcefile" or return errorFromOpen ($sourcefile);
- open INFILE, "<$destfile" or return errorFromOpen ($destfile);
- binmode(OUTFILE);
- binmode(INFILE);
- while(<INFILE>) {
- $line = $_;
-
- if ( $line =~ /UserInstallation/ ) {
- if ($line =~ /(\r\n)/) {
- $lineend = $1;
- }
- elsif ($line =~ /(\n)/) {
- $lineend = $1;
- }
- else {
- $lineend = $/;
- }
- @convert_split = split "=", $line;
- $line = $convert_split[0];
- $line .= "=";
- if ($gui eq $cygwin) {
- $line .= ConvertToFileURL(ConvertCygwinToWin($userinstallpath_without));
- }
- else {
- $line .= ConvertToFileURL($userinstallpath_without);
- }
- $line .= $lineend;
- }
- print OUTFILE "$line";
-
- }
-
- close OUTFILE;
- close INFILE;
- $Error &= unlink ($destfile);
- return ($Error);
-}
-
-sub SetWinLineends () {
- $/ = $WinLineends;
-}
-
-sub SetCygwinLineends () {
- $/ = $CygwinLineends;
-}
-
-sub ConvertToFileURL {
- my ($filename) = @_;
- my ($FileURL);
-
- $FileURL = $FileURLPrefix . $filename;
- $FileURL =~ s/\\/\//g;
- $FileURL =~ s/\/\/\/\//\/\/\//; # 4 slashes to 3 slashes
- return ($FileURL);
-}
-
-sub ConvertCygwinToWin_Shell {
- my ($cygwinpath) = @_;
- my ($winpath);
- $winpath = ConvertCygwinToWin ($cygwinpath);
- $winpath =~ s/\\/\\\\/g;
- return ($winpath);
-}
-
-sub ConvertCygwinToWin {
- my ($cygwinpath) = @_;
- my ($winpath);
- my ($last_lineends) = $/;
- SetCygwinLineends();
- $winpath=`cygpath --windows $cygwinpath`;
- chomp($winpath);
- $/ = $last_lineends;
- return ($winpath);
-}
-
-sub createPath {
- my ($path, $Error) = @_;
- if (!-d "$path") {
- if (!$is_debug) {
- eval {mkpath("$path", 0, 0777)};
- if ($@) {
- print_error ($error_messages[$Error], $Error);
- }
- }
- else {
- print "mkpath($path, 0, 0777)\n";
- }
- }
-}
-
-sub save_sversion {
- my ($sversion) = @_;
- my ($sversion_bak) = $sversion . "_";
- if (-e $sversion) {
- if (-e $sversion_bak) {
- execute_system("$REMOVE_FILE \"$sversion_bak\"");
- }
- execute_system("$COPY_FILE \"$sversion\" \"$sversion_bak\"");
- execute_system("$REMOVE_FILE \"$sversion\"");
- $sversion_saved = 1;
- }
-}
-
-sub restore_sversion {
- my ($sversion) = @_;
- my ($sversion_bak) = $sversion . "_";
- if ($sversion_saved) {
- if (-e $sversion) {
- execute_system("$REMOVE_FILE \"$sversion\"");
- }
- execute_system("$COPY_FILE \"$sversion_bak\" \"$sversion\"");
- execute_system("$REMOVE_FILE \"$sversion_bak\"");
- $sversion_saved = 0;
- }
-}
-
-sub removeOldInstallation {
- my ($installpath) = @_;
- if (!$is_debug) {
- if (-e $installpath) {
- execute_system("$REMOVE_DIR \"$installpath\"");
- }
- if (-e $installpath) {
- print_error ("can not clear old installation in $installpath\n", 3);
- }
- }
-}
-
-sub removeInstallation {
- my ($installpath) = @_;
- if (!$is_debug) {
- if (-e $installpath) {
- execute_system("$REMOVE_DIR \"$installpath\"");
- }
- }
-}
-
-sub deinstallInstallation {
- my ($installpath) = @_;
- my ($productcode);
- if ($gui eq "UNX") { return; }
- if (!$is_debug) {
- if (-e $installpath) {
- $productcode = get_productcode ($installpath);
- print "Productcode: $productcode\n" if ($is_command_infos);
- if ($productcode ne "") {
- print "deinstalling $productcode ...\n";
- $Command = "msiexec.exe -x $productcode -qn";
- execute_Command ($Command, $error_deinst, $show_Message, $command_withoutErrorcheck | $command_withoutOutput);
- }
- }
- }
-}
-
-sub setInstallpath {
- my ($infile, $outfile, $installpath) = @_;
- if (-e $outfile) {
- execute_system ("$REMOVE_FILE \"$outfile\"");
-
- }
- open OUTTABLE, ">$outfile" or die "Error: can\'t open solarfile $outfile";
- open INTABLE, "<$infile" or die "Error: can\'t open solarfile $infile";
- while(<INTABLE>) {
- $line = $_;
- if ( $line =~ /^DESTINATIONPATH=officeinstallpath/ ) {
- $line =~ s/officeinstallpath/$installpath/;
- }
- print OUTTABLE "$line";
- }
- close INTABLE;
- close OUTTABLE;
-}
-
-sub execute_Command {
- my ($Command, $Errorcode, $showMessage, $command_action) = @_;
- my ($Returncode, $output_ref);
- if (!$is_debug) {
- if ( ($command_action & $command_withoutOutput) == $command_withoutOutput) {
- ($Returncode, $output_ref) = execute_system ("$Command");
- }
- else {
- print "$Command\n" if $is_command_infos;
- $Returncode = system ("$Command");
- }
- if ($Returncode) {
- if ($showMessage) {
- if (($command_action & $command_withoutErrorcheck) == $command_withoutErrorcheck) {
- print_warning ($error_messages[$Errorcode], $Errorcode);
- }
- else {
- print_error ($error_messages[$Errorcode], $Errorcode);
- }
- }
- else {
- if (($command_action & $command_withoutErrorcheck) != $command_withoutErrorcheck) {
- do_exit ($Errorcode);
- }
- }
- }
- }
- else {
- print "$Command\n";
- }
- return $output_ref;
-}
-
-sub execute_system {
- my ($command) = shift;
- my (@output_array, $line);
- if ( $is_command_infos ) {
- print STDERR "TRACE_SYSTEM: $command\n";
- }
- open( COMMAND, "$command 2>&1 |");
- while ($line = <COMMAND>) {
- chomp $line;
- push (@output_array, $line);
- }
- close(COMMAND);
- return $?, \@output_array;
-}
-
-sub print_warning
-{
- my $message = shift;
-
- print STDERR "$script_name: ";
- print STDERR "WARNING $message\n";
- return;
-}
-
-sub print_error
-{
- my $message = shift;
- my $error_code = shift;
-
- print STDERR "$script_name: ";
- print STDERR "ERROR: $message\n";
-
- do_exit($error_code);
-}
-
-sub print_notRemoved {
- my ($installpath) = @_;
- print "no deinstallation from $installpath\n";
-}
-
-sub do_exit
-{
- my $error_code = shift;
-
- if ($sversion_saved) {
- restore_sversion ($SVERSION_INI);
- }
- if ($is_remove_on_error) {
- if ($is_do_deinstall) {
- deinstallInstallation ($installpath);
- }
- removeInstallation($installpath);
- }
- else {
- print_notRemoved ($installpath);
- }
- if ( $error_code ) {
- print STDERR "\nFAILURE: $script_name aborted.\n";
- }
- exit($error_code);
-
-}
diff --git a/smoketestoo_native/testlog.pl b/smoketestoo_native/testlog.pl
deleted file mode 100755
index 6b44c75728fb..000000000000
--- a/smoketestoo_native/testlog.pl
+++ /dev/null
@@ -1,286 +0,0 @@
-:
-eval 'exec perl -wS $0 ${1+"$@"}'
- if 0;
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-### globals ###
-
-$is_debug = 0;
-
-$global_log = "log.dat";
-
-%logfiles_list = ("writer", "swlog.dat",
- "math", "smalog.dat",
- "HTML", "shptlog.dat",
- "draw", "sdrwlog.dat",
- "impress", "sdlog.dat",
- "calc", "sclog.dat",
- "chart", "schlog.dat",
- "Java", "javalog.dat",
- "Database", "dblog.dat",
- "Extension", "extlog.dat"
-);
-
-%log = ();
-@ApplicationLog = ();
-$dont_kill ="dont_deinstall";
-$error_str = "error";
-$tests_complete = "---";
-$gui = $ENV{GUI};
-$inpath = $ENV{INPATH};
-$cygwin = "cygwin";
-
-if ($^O =~ /cygwin/) {
- $gui = $cygwin;
-}
-
-if (($gui eq "UNX") or ($gui eq $cygwin)) {
- $pathslash = "/";
-}
-else
-{
- $pathslash = "\\";
-}
-
-$misc = $inpath . $pathslash . "misc" . $pathslash;
-$okfile = $misc . "ok.bat";
-umask (02);
-
-### sub routines ###
-
-sub test_logfile {
- my ($file, $testname) = @_;
- my ($line, $failed, $complete, $linecount, $LastLineError);
-
- $failed = 0;
- $complete = 0;
- $linecount = -1;
- $LastLineError = 0;
-
- if (! -e $file) {
- print "error: $testname failed! Logfile is missing.\n" if $is_debug;
-
- return (0,0);
- }
-
- open TABLE, "<$file" or die "Error: canīt open log file $file]";
-
- while(<TABLE>) {
- $line = $_;
- chomp $line;
- $linecount++;
- if ( $line =~ /$error_str/ ) {
- print "error: $testname: $line\n";
- $failed = 1;
- $LastLineError = 1;
- }
- elsif ( $line =~ /$tests_complete/ ) {
- $complete = 1;
- print "$file: $line\n" if $is_debug;
- }
- else
- {
- print "$testname: $line\n" if $is_debug;
- $LastLineError = 0;
- }
- }
-
- close TABLE;
-
- print "$failed $complete $LastLineError $linecount\n" if $is_debug;
-
- if (!$complete) {
- my $message = "error: $testname: the test was not complete!";
- if ((!$failed) || (($failed) && (!$LastLineError))) {
- my $errormessage = getLog ($testname, $linecount+1);
- if ($errormessage ne "") {
- $message .= " $errormessage possibly failed!";
- }
- }
- if (!$failed && !$is_testerror) {
- print "$message\n";
- }
- }
-
- if (!$failed && $complete) {
- print "true\n" if $is_debug;
- return (1,1);
- }
- else
- {
- print "false\n" if $is_debug;
- return (0,1);
- }
-}
-
-sub readGlobalLog {
- my ($line);
- my $logfilename = $logfiledir . $pathslash . $global_log;
- if (! -e $logfilename) {
- print "$logfilename: file is missing\n" if $is_debug;
- return 0;
- }
-
- open TABLE, "<$logfilename" or die "Error: canīt open log file $logfilename]";
-
- my $failed = 0;
- my $complete = 0;
- my $FirstLine = 1;
- while(defined($line = <TABLE>) and !$complete) {
- chomp $line;
- if ($FirstLine) {
- if ( $line =~ /Sequence of testing/ ) {
- $FirstLine = 0;
- next;
- }
- else {
- print "$logfilename: $line\n" if $is_debug;
- $failed = 1;
- return 0;
- }
- }
- else {
- if ( $line eq "" ) {
- $complete = 1;
- next;
- }
- my @splitedLine = split(/:/,$line);
- my $testApplication = $splitedLine [0];
- $testApplication =~ s/^ *(.*?) *$/$1/g; #truncate
- my $testAction = $splitedLine [1];
- @splitedLine = split(/,/,$testAction);
- my @log_array = ();
- foreach my $action (@splitedLine) {
- $action =~ s/^ *(.*?) *$/$1/g; #truncate
- if ($action =~ /\//) {
- my @splitAction = split(/\//,$action);
- my @specialAction;
- foreach my $doubleaction (@splitAction) {
- $doubleaction =~ s/^ *(.*?) *$/$1/g; #truncate
- push (@specialAction, $doubleaction);
- }
- $action = join (' or ', @specialAction);
- foreach my $doubleaction (@splitAction) {
- push (@log_array, $action);
- }
- }
- else {
- push (@log_array, $action);
- }
- }
- push (@ApplicationLog, $testApplication);
- $log{$testApplication} = \@log_array;
- }
- }
-
- close TABLE;
-
- return 1;
-}
-
-sub getLog {
- my ($testname, $linecount) = @_;
- if ($linecount <= $#{@{$log{$testname}}}) {
- return $log{$testname}[$linecount];
- }
- else {
- return "";
- }
-}
-
-### main ###
-
-$idStr = ' $Revision: 1.6 $ ';
-$idStr =~ /Revision:\s+(\S+)\s+\$/
- ? ($cpflat2minor_rev = $1) : ($cpflat2minor_rev = "-");
-
-print "TestLog -- Version: $cpflat2minor_rev\n";
-
-if (-e $okfile) {
- unlink ($okfile);
-}
-
-if ( ($#ARGV >-1) && ($#ARGV < 1) ) {
- $ARGV[0] =~ s/\"//g;
-}
-
-if ( ! ( ($#ARGV < 1) && $ARGV[0] && (-d $ARGV[0]) ) ) {
- print "Error! Usage: testlog <log_directory>\n" ;
- exit(1);
-}
-
-$logfiledir = $ARGV[0];
-$is_testerror = 0;
-$is_OneTestAvailable = 0;
-
-print "%logfiles_list\n" if $is_debug;
-
-readGlobalLog();
-
-foreach my $applog (@ApplicationLog) {
- if (!exists($logfiles_list{$applog})) {
- next;
- }
- my $logname = $logfiles_list{$applog};
- $current_file = $logfiledir . $pathslash . $logname;
- my ($error, $logfile) = test_logfile ($current_file, $applog);
-
- if ($logfile) {
- $is_OneTestAvailable = 1;
- }
- elsif (!$is_testerror) {
- print "error: $applog failed! Logfile is missing.\n";
- }
-
- if (!$error) {
- $is_testerror = 1;
- }
-
-}
-
-# write file to prevent deinstallation of office
-if ($is_testerror) {
- $dont_del_file = $logfiledir . $pathslash . $dont_kill;
- open (ERRFILE, ">$dont_del_file");
- print ERRFILE "dont delete flag";
- close (ERRFILE);
-}
-else {
- print "$okfile\n" if $is_debug;
- open( OKFILE, ">$okfile");
- print OKFILE "echo ok!\n";
- close( OKFILE );
- chmod (0775, "$okfile");
-}
-
-if (!$is_OneTestAvailable) {
- print "error: no test succeeded! Maybe Office crashed during starting!\n";
- $is_testerror = 1;
-}
-
-exit($is_testerror);
diff --git a/smoketestoo_native/check_setup.pl b/smoketestoo_native/version.map
index 0d5753d1419d..00a28463c5d2 100755..100644
--- a/smoketestoo_native/check_setup.pl
+++ b/smoketestoo_native/version.map
@@ -1,6 +1,3 @@
-:
-eval 'exec perl -wS $0 ${1+"$@"}'
- if 0;
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,44 +23,12 @@ eval 'exec perl -wS $0 ${1+"$@"}'
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
-
-sub checkLogDat {
- my ($setuplogfile) = shift;
- my ($errorfound) = 0;
-
- open SETUPLOG, "<$setuplogfile" or die "canīt open file $setuplogfile";
- while(<SETUPLOG>) {
- $line = $_;
- chomp $line;
- if ($line =~ /^ERR/ ) {
- print "Error: $line\n";
- $errorfound = 1;
- }
- }
- close SETUPLOG;
- return !$errorfound; #check ok?
-}
-
-$idStr = ' $Revision: 1.3 $ ';
-$idStr =~ /Revision:\s+(\S+)\s+\$/
- ? ($prg_rev = $1) : ($prg_rev = "-");
-
-print "checkSetup -- Version: $prg_rev\n";
-
-if ( ($#ARGV >-1) && ($#ARGV < 1) ) {
- $ARGV[0]=~ s/\"//g;
-}
+#***********************************************************************/
-if ( ! ( ($#ARGV >-1) && ($#ARGV < 1) && $ARGV[0] && (-e $ARGV[0] ) ) ) {
- print "Usage: checkSetup <setuplogfile>\n" ;
- exit(1);
-}
+UDK_3_0_0 {
+ global:
+ cppunitTestPlugIn;
-if (checkLogDat ($ARGV[0])) {
- exit (0);
-}
-else {
- print STDERR "ERROR: setup failed\n";
- exit (2);
-}
+ local:
+ *;
+};