'encoding UTF-8 Do not remove or change this line! '************************************************************************* ' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information ' regarding copyright ownership. The ASF licenses this file ' to you under the Apache License, Version 2.0 (the ' "License"); you may not use this file except in compliance ' with the License. You may obtain a copy of the License at ' ' http://www.apache.org/licenses/LICENSE-2.0 ' ' Unless required by applicable law or agreed to in writing, ' software distributed under the License is distributed on an ' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. ' '************************************************************************* '* '* short description : Establish facts of the operating system '* '************************************************************************ '* ' #1 PlatFormInit ' Insert the list variables PlatformName, PlatformExt and PlatormGroup ' #1 getToolPlatform ' Affected variables: gtSystemPath, gTesttoolIni, gtPlatform, gSamePC, gtSYSName, gUser and gHost. ' #1 GetOfficePlatform ' Affected variables: gSamePC, gSystemPath, gSYSName, gTesttoolPath and gOfficePath. ' #1 hGetSystemLanguage ' Get the system language ' #0 hfGetTTProfileName '* '\*********************************************************************** ' define the global definitions for operating systems ' Global Const MAX_PLATFORM = 25 Global gSystemnummer as Integer ' Systeme und Versionen Global Const SYS_00 = 0 Global Const SYS_W95 = 1 Global Const SYS_W98 = 2 Global Const SYS_WSE = 3 Global Const SYS_WME = 4 Global Const SYS_WNT = 5 Global Const SYS_W2K = 6 Global Const SYS_WXP = 7 Global Const SYS_MAC = 8 Global Const SYS_SOL = 9 Global Const SYS_LIN = 10 Global Const SYS_x86 = 11 Global Const SYS_OSX = 12 Global Const SYS_PPC = 13 Global Const SYS_SCO = 14 Global Const SYS_AIX = 15 Global Const SYS_HP = 17 Global Const SYS_FBSD = 18 Global Const SYS_NBSD = 19 Global Const SYS_LIN64 = 20 Global Const SYS_LINSPARC = 21 Global Const SYS_ECS = 22 Global PlatFormGroup(MAX_PLATFORM) as String Global PlatFormName(MAX_PLATFORM) as String Global PlatFormExt(MAX_PLATFORM) as String sub PlatFormInit '///Initialize information arrays '///+Supported Operating Systems: '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+
NameShort NamePlatgroup
Win95w95w95
Win98w98w95
Win98SEwsew95
Win98MEwmes95
WinNTwntw95
Win2000w2kw95
WinXPwxpw95
Solaris SPARCsolunx
Solaris x86x86unx
Linuxlinunx
Mac OS Xosxunx
Linux PPCppcunx
SCO UNIXscounx
AIXaixunx
HP UNIXhpunx
FreeBSDfbsdunx
NetBSDnbsdunx
Linux 64 bitlin64unx
Linux SPARClinsparcunx
eComStationecsecs
PlatFormName(SYS_00) = "Unknown" : PlatFormExt(SYS_00) = "a00" PlatFormName(SYS_W95) = "Win95" : PlatFormExt(SYS_W95) = "w95" PlatFormName(SYS_W98) = "Win98" : PlatFormExt(SYS_W98) = "w98" PlatFormName(SYS_WSE) = "Win98SE" : PlatFormExt(SYS_WSE) = "wse" PlatFormName(SYS_WME) = "Win98ME" : PlatFormExt(SYS_WME) = "wme" PlatFormName(SYS_WNT) = "WinNT" : PlatFormExt(SYS_WNT) = "wnt" PlatFormName(SYS_W2K) = "Win2000" : PlatFormExt(SYS_W2K) = "w2k" PlatFormName(SYS_WXP) = "WinXP" : PlatFormExt(SYS_WXP) = "wxp" PlatFormName(SYS_SOL) = "Solaris SPARC" : PlatFormExt(SYS_SOL) = "sol" PlatFormName(SYS_X86) = "Solaris x86" : PlatFormExt(SYS_X86) = "x86" PlatFormName(SYS_LIN) = "Linux" : PlatFormExt(SYS_LIN) = "lin" PlatformName(SYS_OSX) = "Mac OS X" : PlatformExt(SYS_OSX) = "osx" PlatformName(SYS_PPC) = "Linux PPC" : PlatformExt(SYS_PPC) = "ppc" PlatFormName(SYS_SCO) = "SCO Unix" : PlatFormExt(SYS_SCO) = "sco" PlatFormName(SYS_AIX) = "AIX" : PlatFormExt(SYS_AIX) = "aix" PlatFormName(SYS_HP) = "HP UNIX" : PlatFormExt(SYS_Hp) = "hp" PlatFormName(SYS_FBSD) = "FreeBSD" : PlatFormExt(SYS_FBSD) = "fbsd" PlatFormName(SYS_NBSD) = "NetBSD" : PlatFormExt(SYS_NBSD) = "nbsd" PlatFormName(SYS_LIN64) = "Linux 64 bit" : PlatFormExt(SYS_LIN64)= "lin64" PlatFormName(SYS_LINSPARC) = "Linux SPARC" : PlatFormExt(SYS_LINSPARC) = "linsparc" PlatFormName(SYS_ECS) = "eComStation" : PlatFormExt(SYS_ECS) = "ecs" PlatFormGroup(SYS_00) = "a00" PlatFormGroup(SYS_W95) = "w95" PlatFormGroup(SYS_W98) = "w95" PlatFormGroup(SYS_WSE) = "w95" PlatFormGroup(SYS_WME) = "w95" PlatFormGroup(SYS_WNT) = "w95" PlatFormGroup(SYS_W2K) = "w95" PlatFormGroup(SYS_WXP) = "w95" PlatFormGroup(SYS_SOL) = "unx" PlatFormGroup(SYS_X86) = "unx" PlatFormGroup(SYS_LIN) = "unx" PlatFormGroup(SYS_OSX) = "unx" PlatFormGroup(SYS_PPC) = "unx" PlatFormGroup(SYS_SCO) = "unx" PlatFormGroup(SYS_AIX) = "unx" PlatFormGroup(SYS_HP) = "unx" PlatFormGroup(SYS_FBSD) = "unx" PlatFormGroup(SYS_NBSD) = "unx" PlatFormGroup(SYS_LIN64)= "unx" PlatFormGroup(SYS_LINSPARC) = "unx" PlatFormGroup(SYS_ECS) = "ecs" end sub '------------------------------------------------------------------------- sub GetToolPlatform '///Get all information about the system where the testtool runs. '///The following global variables will be set: '///+ Dim GUI as Integer Dim iGUIVersion as Integer Dim gtIniPath as String Dim i% : Dim k% Call PlatFormInit '///Get GUI information -> global definition of the operating system (Windows, UNIX, etc.) '///+ GUI is a systemvariable, it can get by testtool (1 =" Windows; 4 => UNIX [depricated 2 was " OS/2;]) GUI = GetGUIType select case GUI case 1 : gtSystemPath = GetApplicationPath + "\" 'Change from 'windir' to internal instruction gUser = environ ("vcsid") if (gUser = "") then gUser = environ ("USERNAME") end if gtIniPath = gtSystemPath case 2 : ' For eComStation all variables must point to the same directory gUser = environ ("HOME") if ( gUser = "" ) then warnlog( "Please add the HOME variable to the environment and make it point to the directory you wat to store your personal setting in." end if gtSystemPath = gUser & "\" gtIniPath = gtSystemPath case 4 : gtSystemPath = getApplicationPath + "/" gUser = environ ("USER") if (gUser = "") then gUser = environ ("LOGNAME") ' on some Unix systems end if gtIniPath = gtSystemPath case else : QAErrorLog "Not supported operating system! Please write an issue about it (qa/testscripts)! The 'GetGUIType' command is returning '" & GUI & "'." QAErrorLog "Setting 'GUI' variable to 4 (=Unix) to try testing. If it fails you have to wait until your issue will have been fixed." GUI = 4 gtSystemPath = getApplicationPath + "/" gUser = environ ("USER") if (gUser = "") then gUser = environ ("LOGNAME") ' on some Unix systems end if gtIniPath = gtSystemPath end select '///Get GUI version -> Detailed definition of the operating system (Win95, WinNT, Win2000, Linux, Sparc, x86 etc.) '///+This data can be get only out of the testtool.ini/.testtoolrc '///+Here is the list, which entries for which OS '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+
NameValue
Win95100
Win98395
WinNT351 or 400
WinSE410
WinME490
Win2000500
WinXP501
Solaris SPARC01
Linux03
Solaris x8605
Mac OS X12
Linux PPC13
SCO UNIX02
AIX04
HP UNIX07
FreeBSD08
NetBSD14
Linux 64 bit15
Linux SPARC16
eComStation17
'///Get the path to testtool.ini/.testtoolrc if GUI = 4 then gTesttoolIni = gtIniPath + ".testtoolrc" gSVersionIni = gtIniPath + ".sversionrc" else gTesttoolIni = gtIniPath + "testtool.ini" gSVersionIni = gtIniPath + "sversion.ini" end if if Dir (gTesttoolIni) = "" then if GUI <> 4 then MsgBox ("The Test ends, because 'testtool.ini' is missing at : "+ Chr(13) + gTesttoolIni, 1, "Config-file for testtool is missing") else MsgBox ("The Test ends, because '.testtoolrc' is missing at : " + Chr(13) + gTesttoolIni, 1, "Config-file for testtool is missing") end if end end if '///Get iGuiVersion out of testtool.ini/.testtoolrc iGuiVersion = GetIniValue (gTesttoolIni, "GUI Platform", "Current") if iGuiVersion = 0 then if GUI <> 4 then iGuiVersion = 400 qaErrorLog("The GUI-entry in '" + gTesttoolIni + "' is missing!"+Chr(13)+"Please insert the correct number for your operating system! In Section [GUI Platform], entry Current= "+Chr(13)+"Win95....: 100"+Chr(13)+"Win98....: 395"+Chr(13)+"WinNT....: 351 or 400"+Chr(13)+"WinSE....: 410"+Chr(13)+"WinME....: 490"+Chr(13)+"Win2000..: 500"+Chr(13)+"WinXP....: 501") else iGuiVersion = 01 QAErrorLog("The GUI value in '" + gTesttoolIni + "' is missing!"+Chr(13)+"Please insert the correct number for your operating system! In Section [GUI Platform], entry Current= "+Chr(13)+"Solaris SPARC.: 01"+Chr(13)+"SCO UNIX......: 02"+Chr(13)+"Linux.........: 03"+Chr(13)+"AIX...........: 04"+Chr(13)+"Solaris x86...: 05"+Chr(13)+"HP-UX.........: 07"+Chr(13)+"FreeBSD........: 08"+Chr(13)+"Mac OS X......: 12"+Chr(13)+"Linux PPC.....: 13"+Chr(13)+"NetBSD.....: 14"+Chr(13)+"Linux 64 bit.....: 15"+Chr(13)+"Linux SPARC.....: 16") end if end if '///Get the variable gSamePC gHost = GetIniValue (gTesttoolIni, "Communication", "Host") if (gHost = "") then gHost = "LOCALHOST" ' if entry is not in configuration file set default value if uCase (gHost) = "LOCALHOST" then ' ein Client kann immer nur lokal sein gSamePC = TRUE else gSamePC = FALSE end if '///Set gtPlatform and gtSYSName select case GUI case 1: 'Windows select case iGuiVersion case 100: gSystemnummer = SYS_W95 case 351: gSystemnummer = SYS_WNT case 395: gSystemnummer = SYS_W95 case 400: gSystemnummer = SYS_WNT case 410: gSystemnummer = SYS_WSE case 490: gSystemnummer = SYS_WME case 500: gSystemnummer = SYS_W2K case 501: gSystemnummer = SYS_WXP case else: Print "Unknown OS ("+GUI+"/"+iGuiVersion+") please insert in sysinfo.inc::GetToolPlatform, WinNT will be used now." gSystemnummer = SYS_WNT end select case 2: 'eComStation select case iGuiVersion case 17: gSystemNummer = SYS_ECS case else: Print "Unknown OS ("+GUI+"/"+iGuiVersion+") please insert in sysinfo.inc::GetToolPlatform, WinNT will be used now." gSystemNummer = SYS_ECS end select case 3: 'Deprecated OSes: - (2) OS/2 2.x, 3.x, 4 (Merlin), 4.5 (Aurora) ' - (3) Mac OS Classic print "Deprecated OS ("+GUI+"/"+iGuiVersion+") please insert in sysinfo.inc::GetToolPlatform." gSystemnummer = SYS_SOL case 4: 'UNIX select case iGuiVersion case 01 : gSystemnummer = SYS_SOL case 02 : gSystemnummer = SYS_SCO case 03 : gSystemnummer = SYS_LIN case 04 : gSystemnummer = SYS_AIX case 05 : gSystemnummer = SYS_X86 case 07 : gSystemnummer = SYS_HP case 08 : gSystemnummer = SYS_FBSD case 12 : gSystemnummer = SYS_OSX case 13 : gSystemnummer = SYS_PPC case 14 : gSystemnummer = SYS_NBSD case 15 : gSystemnummer = SYS_LIN64 case 16 : gSystemnummer = SYS_LINSPARC case else: Print "Unknown OS ("+GUI+"/"+iGuiVersion+") please insert in sysinfo.inc::GetToolPlatform. TestTool will try to use the same environment as Solaris SPARC uses." gSystemnummer = SYS_SOL end select end select gtPlatform = PlatFormExt(gSystemnummer) gtSYSName = PlatFormName(gSystemnummer) end sub '------------------------------------------------------------------------- sub GetOfficePlatform '///Get all information about the system where the office is running. '///The following global variables will be set: '///+ '///If the Testtool and the office are running on the same machine (gSamePC = TRUE) then all variables have the same value. '///+If not the value of Aktuell in section [Office Platform] has to be set in testtool.ini/.testtoolrc (testing remotely) '///+the variables are : '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+ '///+
NameEntry in testtool.ini
Win95WIN95
Win98WIN98
WinSEWIN98SE
WinMEWIN98ME
WinNTWINNT
Win2000WIN2000
WinXPWINXP
Solaris SPARCSOLARIS
LinuxLINUX
Solaris x86X86
Mac OS XOSX
Linux PPCPPC
SCO UNIXSCO
AIXAIX
HP UNIXHP
FreeBSDFBSD
NetBSDNBSD
Linux 64 bitLIN64
Linux SPARCLINSPARC
eComStationecs
Dim GuiString as String Dim GUI as Integer if gSamePC = FALSE then GuiString = UCase (GetIniValue (gTesttoolIni, "Office Platform", "Current")) select case GuiString case "WIN95" : GUI = 1 case "WIN98" : GUI = 2 case "WIN98SE" : GUI = 3 case "WIN98ME" : GUI = 4 case "WINNT" : GUI = 5 case "WIN2000" : GUI = 6 case "WINXP" : GUI = 7 case "SOLARIS" : GUI = 9 case "LINUX" : GUI = 10 case "X86" : GUI = 11 case "OSX" : GUI = 12 case "PPC" : GUI = 13 case "SCO" : GUI = 14 case "AIX" : GUI = 15 case "HP" : GUI = 17 case "FBSD" : GUI = 18 case "NBSD" : GUI = 19 case "LIN64" : GUI = 20 case "LINSPARC": GUI = 21 case "ECS" : GUI = 22 case else : print "Unknown operating system : '" & GuiString & "'. The test run should be canceled." exit sub end select gPlatform = PlatFormExt(GUI) gSYSName = PlatFormName(GUI) gPlatGroup = PlatFormGroup(GUI) else gPlatform = gtPlatform gSYSName = gtSYSName gPlatGroup = PlatFormGroup(gSystemnummer) end if end sub '------------------------------------------------------------------------- function hGetSystemLanguage as Integer '///Get the systemlanguage (ID) Dim sDummy as String hGetSystemLanguage = 0 try sDummy = GetSystemLanguage catch print "You are testing an Office, that wasn't synced at least with version srx 644r Build 8509! \n Please call the Developer, that provided the CWS to you and tell him to resync !!!!!!!!!!" end endcatch if sDummy = "" then warnlog "sysinfo.inc::hGetSystemLanguage: The Systemlanguage is unknown, the default will be 01 = English (USA)." hGetSystemLanguage = 1 else hGetSystemLanguage = ConvertCodeToLanguage (sDummy) end if end function '------------------------------------------------------------------------- function hfGetTTProfileName as string ' Author: JSI, 22. January 2003 '/// Get the current profile name in the TestTool control file (testtool.ini / .testtoolrc). hfGetTTProfileName = GetIniValue (gTesttoolIni, "Misc", "CurrentProfile") end function