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