os/graphics/egl/egltest/endpointtestsuite/automated/res/endpoint_autotest_ini_config.bat
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
@echo off
sl@0
     2
sl@0
     3
sl@0
     4
REM Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     5
REM All rights reserved.
sl@0
     6
REM This component and the accompanying materials are made available
sl@0
     7
REM under the terms of "Eclipse Public License v1.0"
sl@0
     8
REM which accompanies this distribution, and is available
sl@0
     9
REM at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
    10
REM
sl@0
    11
REM Initial Contributors:
sl@0
    12
REM Nokia Corporation - initial contribution.
sl@0
    13
REM
sl@0
    14
REM Contributors:
sl@0
    15
REM
sl@0
    16
REM Description:
sl@0
    17
REM
sl@0
    18
sl@0
    19
REM Batch file used for installing the correct environment (epoc.ini, wsini.ini,
sl@0
    20
REM testexecute.ini) for running the automatic egl endpoint tests that require the 
sl@0
    21
REM automated test renderstage in wserv. This file does the correct thing in mistral.
sl@0
    22
REM
sl@0
    23
REM Commands:
sl@0
    24
REM endpoint_autotest_ini_config.bat install
sl@0
    25
REM endpoint_autotest_ini_config.bat uninstall 
sl@0
    26
sl@0
    27
sl@0
    28
REM Constants.
sl@0
    29
set WS_FILENAME=wsini.ini
sl@0
    30
set WS_ALT_FILENAME=wsini_minigui.ini
sl@0
    31
set WS_ALT2_FILENAME=mingui_wsini.ini
sl@0
    32
set WS_REPLACEMENT=endpoint_autotest_wsini.ini
sl@0
    33
sl@0
    34
set EMULATOR_PATH_UDEB=%EPOCROOT%epoc32\release\winscw\udeb
sl@0
    35
set EMULATOR_PATH_UREL=%EPOCROOT%epoc32\release\winscw\urel
sl@0
    36
set HARDWARE_PATH=%EPOCROOT%epoc32\data
sl@0
    37
sl@0
    38
sl@0
    39
if /i "%1"=="uninstall" goto :uninstall
sl@0
    40
if /i "%1"=="install" goto :install
sl@0
    41
if /i "%1"=="help" goto :help
sl@0
    42
sl@0
    43
sl@0
    44
:help
sl@0
    45
	echo.
sl@0
    46
	echo Description:
sl@0
    47
	echo This script installs the correct environment (epoc.ini, wsini.ini, testexecute.ini) for the automatic egl endpoint tests.
sl@0
    48
	echo.It takes the argument "install or "uninstall"
sl@0
    49
goto :EOF
sl@0
    50
sl@0
    51
sl@0
    52
:move
sl@0
    53
	set SRC=%1
sl@0
    54
	set DST=%2
sl@0
    55
	if exist %SRC% copy %SRC% %DST% >NUL
sl@0
    56
	if exist %SRC% del %SRC% >NUL
sl@0
    57
	goto :EOF
sl@0
    58
sl@0
    59
	
sl@0
    60
:copy
sl@0
    61
	set SRC=%1
sl@0
    62
	set DST=%2
sl@0
    63
	if exist %SRC% copy %SRC% %DST% >NUL
sl@0
    64
	goto :EOF
sl@0
    65
sl@0
    66
	
sl@0
    67
:backupAndInstallWsini
sl@0
    68
	set ORIGINAL_FILE=%1
sl@0
    69
	REM Save original and copy the modified wsini file to the specified location.
sl@0
    70
	call :copy %ORIGINAL_FILE% %ORIGINAL_FILE%.backup
sl@0
    71
	if defined EMULATOR_DATA_DIR (
sl@0
    72
		call :copy %EMULATOR_DATA_DIR%\z\egltest\%WS_REPLACEMENT% %ORIGINAL_FILE%
sl@0
    73
	) else (
sl@0
    74
		REM We assume that the file is in the same directory as this batch file.
sl@0
    75
		call :copy %~dp0\%WS_REPLACEMENT% %ORIGINAL_FILE%
sl@0
    76
	)
sl@0
    77
	goto :EOF
sl@0
    78
sl@0
    79
sl@0
    80
:backupAndInstallEpoc
sl@0
    81
	set ORIGINAL_FILE=%1
sl@0
    82
	REM Save original and add minigui to epoc.ini
sl@0
    83
	perl -p -i.backup -e "s/^.*SYMBIAN_(GRAPHICS|BASE)_USE_GCE.*$//i" %ORIGINAL_FILE%
sl@0
    84
	echo. >> %ORIGINAL_FILE%
sl@0
    85
	echo SYMBIAN_GRAPHICS_USE_GCE ON >> %ORIGINAL_FILE%
sl@0
    86
	echo SYMBIAN_BASE_USE_GCE ON >> %ORIGINAL_FILE%
sl@0
    87
	echo ScreenWidth 320 >> %ORIGINAL_FILE%
sl@0
    88
	echo ScreenHeight 480 >> %ORIGINAL_FILE%
sl@0
    89
	echo ScreenOffsetX 0 >> %ORIGINAL_FILE%
sl@0
    90
	echo ScreenOffsetY 0 >> %ORIGINAL_FILE%
sl@0
    91
	echo FasciaBitmap null >> %ORIGINAL_FILE%
sl@0
    92
	echo minigui >> %ORIGINAL_FILE%
sl@0
    93
	echo. >> %ORIGINAL_FILE%
sl@0
    94
	goto :EOF
sl@0
    95
	
sl@0
    96
sl@0
    97
:backupAndInstallTestexecute
sl@0
    98
	set ORIGINAL_FILE=%1
sl@0
    99
	REM Disable SystemStarter in testexecute.ini 
sl@0
   100
	perl -p -i.backup -e "s/SystemStarter.*ON.*$/SystemStarter = OFF/i" %ORIGINAL_FILE%
sl@0
   101
	goto :EOF
sl@0
   102
sl@0
   103
sl@0
   104
:install
sl@0
   105
	REM Start with the original files if we previously missed an uninstall.
sl@0
   106
	call :uninstall
sl@0
   107
	
sl@0
   108
	REM Install epoc.ini.
sl@0
   109
	if defined EPOC_INI (
sl@0
   110
		call :backupAndInstallEpoc %EPOC_INI%
sl@0
   111
	) else (
sl@0
   112
		call :backupAndInstallEpoc %EPOCROOT%epoc32\data\epoc.ini
sl@0
   113
	)
sl@0
   114
	
sl@0
   115
	REM Install testexecute.ini.
sl@0
   116
	if defined EMULATOR_C_DIR (
sl@0
   117
		call :backupAndInstallTestexecute %EMULATOR_C_DIR%\system\data\testexecute.ini
sl@0
   118
	) else (
sl@0
   119
		call :backupAndInstallTestexecute %EPOCROOT%epoc32\winscw\c\system\data\testexecute.ini
sl@0
   120
		call :backupAndInstallTestexecute %EPOCROOT%epoc32\data\z\system\data\testexecute.ini
sl@0
   121
	)
sl@0
   122
	
sl@0
   123
	REM Must use different paths if running on Mistral (indicated by EMULATOR_DATA_DIR).
sl@0
   124
	REM If not Mistral, change emulator urel and udeb variants and hardware locations. 
sl@0
   125
	if defined EMULATOR_DATA_DIR (
sl@0
   126
		call :backupAndInstallWsini %EMULATOR_DATA_DIR%\z\system\data\%WS_FILENAME%
sl@0
   127
	) else (
sl@0
   128
		call :backupAndInstallWsini %EMULATOR_PATH_UDEB%\z\system\data\%WS_FILENAME%
sl@0
   129
		call :backupAndInstallWsini %EMULATOR_PATH_UREL%\z\system\data\%WS_FILENAME%
sl@0
   130
		call :backupAndInstallWsini %HARDWARE_PATH%\z\system\data\%WS_FILENAME%
sl@0
   131
		call :backupAndInstallWsini %HARDWARE_PATH%\z\%WS_ALT_FILENAME%
sl@0
   132
		call :backupAndInstallWsini %HARDWARE_PATH%\z\system\data\%WS_ALT2_FILENAME%
sl@0
   133
	)
sl@0
   134
	
sl@0
   135
	goto :EOF
sl@0
   136
sl@0
   137
	
sl@0
   138
:uninstall
sl@0
   139
	REM Uninstall epoc.ini.
sl@0
   140
	if defined EPOC_INI (
sl@0
   141
		call :move %EPOC_INI%.backup %EPOC_INI%
sl@0
   142
	) else (
sl@0
   143
		call :move %EPOCROOT%epoc32\data\epoc.ini.backup %EPOCROOT%epoc32\data\epoc.ini
sl@0
   144
	)
sl@0
   145
	
sl@0
   146
	REM Uninstall testexecute.ini.
sl@0
   147
	if defined EMULATOR_C_DIR (
sl@0
   148
		call :move %EMULATOR_C_DIR%\system\data\testexecute.ini.backup %EMULATOR_C_DIR%\system\data\testexecute.ini
sl@0
   149
	) else (
sl@0
   150
		call :move %EPOCROOT%epoc32\winscw\c\system\data\testexecute.ini.backup %EPOCROOT%epoc32\winscw\c\system\data\testexecute.ini
sl@0
   151
		call :move %EPOCROOT%epoc32\data\z\system\data\testexecute.ini.backup %EPOCROOT%epoc32\data\z\system\data\testexecute.ini
sl@0
   152
	)
sl@0
   153
sl@0
   154
	REM Must use different paths if running on Mistral (indicated by EMULATOR_DATA_DIR).
sl@0
   155
	REM If not Mistral, change urel and udeb variants.
sl@0
   156
	if defined EMULATOR_DATA_DIR (
sl@0
   157
		REM Restore the backed up files.
sl@0
   158
		call :move %EMULATOR_DATA_DIR%\z\system\data\%WS_FILENAME%.backup %EMULATOR_DATA_DIR%\z\system\data\%WS_FILENAME%
sl@0
   159
	) else (
sl@0
   160
		REM Restore the backed up files.
sl@0
   161
		call :move %EMULATOR_PATH_UDEB%\z\system\data\%WS_FILENAME%.backup %EMULATOR_PATH_UDEB%\z\system\data\%WS_FILENAME%
sl@0
   162
		call :move %EMULATOR_PATH_UREL%\z\system\data\%WS_FILENAME%.backup %EMULATOR_PATH_UREL%\z\system\data\%WS_FILENAME%
sl@0
   163
		call :move %HARDWARE_PATH%\z\system\data\%WS_FILENAME%.backup %HARDWARE_PATH%\z\system\data\%WS_FILENAME%
sl@0
   164
		call :move %HARDWARE_PATH%\z\%WS_ALT_FILENAME%.backup %HARDWARE_PATH%\z\%WS_ALT_FILENAME%
sl@0
   165
		call :move %HARDWARE_PATH%\z\system\data\%WS_ALT2_FILENAME%.backup %HARDWARE_PATH%\z\system\data\%WS_ALT2_FILENAME%
sl@0
   166
	)
sl@0
   167
sl@0
   168
	goto :EOF