os/graphics/egl/egltest/endpointtestsuite/automated/res/endpoint_autotest_ini_config.bat
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/egl/egltest/endpointtestsuite/automated/res/endpoint_autotest_ini_config.bat	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,168 @@
     1.4 +@echo off
     1.5 +
     1.6 +
     1.7 +REM Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     1.8 +REM All rights reserved.
     1.9 +REM This component and the accompanying materials are made available
    1.10 +REM under the terms of "Eclipse Public License v1.0"
    1.11 +REM which accompanies this distribution, and is available
    1.12 +REM at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.13 +REM
    1.14 +REM Initial Contributors:
    1.15 +REM Nokia Corporation - initial contribution.
    1.16 +REM
    1.17 +REM Contributors:
    1.18 +REM
    1.19 +REM Description:
    1.20 +REM
    1.21 +
    1.22 +REM Batch file used for installing the correct environment (epoc.ini, wsini.ini,
    1.23 +REM testexecute.ini) for running the automatic egl endpoint tests that require the 
    1.24 +REM automated test renderstage in wserv. This file does the correct thing in mistral.
    1.25 +REM
    1.26 +REM Commands:
    1.27 +REM endpoint_autotest_ini_config.bat install
    1.28 +REM endpoint_autotest_ini_config.bat uninstall 
    1.29 +
    1.30 +
    1.31 +REM Constants.
    1.32 +set WS_FILENAME=wsini.ini
    1.33 +set WS_ALT_FILENAME=wsini_minigui.ini
    1.34 +set WS_ALT2_FILENAME=mingui_wsini.ini
    1.35 +set WS_REPLACEMENT=endpoint_autotest_wsini.ini
    1.36 +
    1.37 +set EMULATOR_PATH_UDEB=%EPOCROOT%epoc32\release\winscw\udeb
    1.38 +set EMULATOR_PATH_UREL=%EPOCROOT%epoc32\release\winscw\urel
    1.39 +set HARDWARE_PATH=%EPOCROOT%epoc32\data
    1.40 +
    1.41 +
    1.42 +if /i "%1"=="uninstall" goto :uninstall
    1.43 +if /i "%1"=="install" goto :install
    1.44 +if /i "%1"=="help" goto :help
    1.45 +
    1.46 +
    1.47 +:help
    1.48 +	echo.
    1.49 +	echo Description:
    1.50 +	echo This script installs the correct environment (epoc.ini, wsini.ini, testexecute.ini) for the automatic egl endpoint tests.
    1.51 +	echo.It takes the argument "install or "uninstall"
    1.52 +goto :EOF
    1.53 +
    1.54 +
    1.55 +:move
    1.56 +	set SRC=%1
    1.57 +	set DST=%2
    1.58 +	if exist %SRC% copy %SRC% %DST% >NUL
    1.59 +	if exist %SRC% del %SRC% >NUL
    1.60 +	goto :EOF
    1.61 +
    1.62 +	
    1.63 +:copy
    1.64 +	set SRC=%1
    1.65 +	set DST=%2
    1.66 +	if exist %SRC% copy %SRC% %DST% >NUL
    1.67 +	goto :EOF
    1.68 +
    1.69 +	
    1.70 +:backupAndInstallWsini
    1.71 +	set ORIGINAL_FILE=%1
    1.72 +	REM Save original and copy the modified wsini file to the specified location.
    1.73 +	call :copy %ORIGINAL_FILE% %ORIGINAL_FILE%.backup
    1.74 +	if defined EMULATOR_DATA_DIR (
    1.75 +		call :copy %EMULATOR_DATA_DIR%\z\egltest\%WS_REPLACEMENT% %ORIGINAL_FILE%
    1.76 +	) else (
    1.77 +		REM We assume that the file is in the same directory as this batch file.
    1.78 +		call :copy %~dp0\%WS_REPLACEMENT% %ORIGINAL_FILE%
    1.79 +	)
    1.80 +	goto :EOF
    1.81 +
    1.82 +
    1.83 +:backupAndInstallEpoc
    1.84 +	set ORIGINAL_FILE=%1
    1.85 +	REM Save original and add minigui to epoc.ini
    1.86 +	perl -p -i.backup -e "s/^.*SYMBIAN_(GRAPHICS|BASE)_USE_GCE.*$//i" %ORIGINAL_FILE%
    1.87 +	echo. >> %ORIGINAL_FILE%
    1.88 +	echo SYMBIAN_GRAPHICS_USE_GCE ON >> %ORIGINAL_FILE%
    1.89 +	echo SYMBIAN_BASE_USE_GCE ON >> %ORIGINAL_FILE%
    1.90 +	echo ScreenWidth 320 >> %ORIGINAL_FILE%
    1.91 +	echo ScreenHeight 480 >> %ORIGINAL_FILE%
    1.92 +	echo ScreenOffsetX 0 >> %ORIGINAL_FILE%
    1.93 +	echo ScreenOffsetY 0 >> %ORIGINAL_FILE%
    1.94 +	echo FasciaBitmap null >> %ORIGINAL_FILE%
    1.95 +	echo minigui >> %ORIGINAL_FILE%
    1.96 +	echo. >> %ORIGINAL_FILE%
    1.97 +	goto :EOF
    1.98 +	
    1.99 +
   1.100 +:backupAndInstallTestexecute
   1.101 +	set ORIGINAL_FILE=%1
   1.102 +	REM Disable SystemStarter in testexecute.ini 
   1.103 +	perl -p -i.backup -e "s/SystemStarter.*ON.*$/SystemStarter = OFF/i" %ORIGINAL_FILE%
   1.104 +	goto :EOF
   1.105 +
   1.106 +
   1.107 +:install
   1.108 +	REM Start with the original files if we previously missed an uninstall.
   1.109 +	call :uninstall
   1.110 +	
   1.111 +	REM Install epoc.ini.
   1.112 +	if defined EPOC_INI (
   1.113 +		call :backupAndInstallEpoc %EPOC_INI%
   1.114 +	) else (
   1.115 +		call :backupAndInstallEpoc %EPOCROOT%epoc32\data\epoc.ini
   1.116 +	)
   1.117 +	
   1.118 +	REM Install testexecute.ini.
   1.119 +	if defined EMULATOR_C_DIR (
   1.120 +		call :backupAndInstallTestexecute %EMULATOR_C_DIR%\system\data\testexecute.ini
   1.121 +	) else (
   1.122 +		call :backupAndInstallTestexecute %EPOCROOT%epoc32\winscw\c\system\data\testexecute.ini
   1.123 +		call :backupAndInstallTestexecute %EPOCROOT%epoc32\data\z\system\data\testexecute.ini
   1.124 +	)
   1.125 +	
   1.126 +	REM Must use different paths if running on Mistral (indicated by EMULATOR_DATA_DIR).
   1.127 +	REM If not Mistral, change emulator urel and udeb variants and hardware locations. 
   1.128 +	if defined EMULATOR_DATA_DIR (
   1.129 +		call :backupAndInstallWsini %EMULATOR_DATA_DIR%\z\system\data\%WS_FILENAME%
   1.130 +	) else (
   1.131 +		call :backupAndInstallWsini %EMULATOR_PATH_UDEB%\z\system\data\%WS_FILENAME%
   1.132 +		call :backupAndInstallWsini %EMULATOR_PATH_UREL%\z\system\data\%WS_FILENAME%
   1.133 +		call :backupAndInstallWsini %HARDWARE_PATH%\z\system\data\%WS_FILENAME%
   1.134 +		call :backupAndInstallWsini %HARDWARE_PATH%\z\%WS_ALT_FILENAME%
   1.135 +		call :backupAndInstallWsini %HARDWARE_PATH%\z\system\data\%WS_ALT2_FILENAME%
   1.136 +	)
   1.137 +	
   1.138 +	goto :EOF
   1.139 +
   1.140 +	
   1.141 +:uninstall
   1.142 +	REM Uninstall epoc.ini.
   1.143 +	if defined EPOC_INI (
   1.144 +		call :move %EPOC_INI%.backup %EPOC_INI%
   1.145 +	) else (
   1.146 +		call :move %EPOCROOT%epoc32\data\epoc.ini.backup %EPOCROOT%epoc32\data\epoc.ini
   1.147 +	)
   1.148 +	
   1.149 +	REM Uninstall testexecute.ini.
   1.150 +	if defined EMULATOR_C_DIR (
   1.151 +		call :move %EMULATOR_C_DIR%\system\data\testexecute.ini.backup %EMULATOR_C_DIR%\system\data\testexecute.ini
   1.152 +	) else (
   1.153 +		call :move %EPOCROOT%epoc32\winscw\c\system\data\testexecute.ini.backup %EPOCROOT%epoc32\winscw\c\system\data\testexecute.ini
   1.154 +		call :move %EPOCROOT%epoc32\data\z\system\data\testexecute.ini.backup %EPOCROOT%epoc32\data\z\system\data\testexecute.ini
   1.155 +	)
   1.156 +
   1.157 +	REM Must use different paths if running on Mistral (indicated by EMULATOR_DATA_DIR).
   1.158 +	REM If not Mistral, change urel and udeb variants.
   1.159 +	if defined EMULATOR_DATA_DIR (
   1.160 +		REM Restore the backed up files.
   1.161 +		call :move %EMULATOR_DATA_DIR%\z\system\data\%WS_FILENAME%.backup %EMULATOR_DATA_DIR%\z\system\data\%WS_FILENAME%
   1.162 +	) else (
   1.163 +		REM Restore the backed up files.
   1.164 +		call :move %EMULATOR_PATH_UDEB%\z\system\data\%WS_FILENAME%.backup %EMULATOR_PATH_UDEB%\z\system\data\%WS_FILENAME%
   1.165 +		call :move %EMULATOR_PATH_UREL%\z\system\data\%WS_FILENAME%.backup %EMULATOR_PATH_UREL%\z\system\data\%WS_FILENAME%
   1.166 +		call :move %HARDWARE_PATH%\z\system\data\%WS_FILENAME%.backup %HARDWARE_PATH%\z\system\data\%WS_FILENAME%
   1.167 +		call :move %HARDWARE_PATH%\z\%WS_ALT_FILENAME%.backup %HARDWARE_PATH%\z\%WS_ALT_FILENAME%
   1.168 +		call :move %HARDWARE_PATH%\z\system\data\%WS_ALT2_FILENAME%.backup %HARDWARE_PATH%\z\system\data\%WS_ALT2_FILENAME%
   1.169 +	)
   1.170 +
   1.171 +	goto :EOF