securitysettings/qtconfigutils/tsrc/run_wst.bat
author hgs
Mon, 24 May 2010 20:32:47 +0300
changeset 26 9abfd4f00d37
permissions -rw-r--r--
201021
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26
hgs
parents:
diff changeset
     1
::=============================================================================
hgs
parents:
diff changeset
     2
:: Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
:: All rights reserved.
hgs
parents:
diff changeset
     4
:: This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
:: under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
:: which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
:: at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
::
hgs
parents:
diff changeset
     9
:: Initial Contributors:
hgs
parents:
diff changeset
    10
:: Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
::
hgs
parents:
diff changeset
    12
:: Contributors:
hgs
parents:
diff changeset
    13
::
hgs
parents:
diff changeset
    14
:: Description:
hgs
parents:
diff changeset
    15
::
hgs
parents:
diff changeset
    16
::=============================================================================
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
:: Script(s) uses following environment settings:
hgs
parents:
diff changeset
    19
:: - CD
hgs
parents:
diff changeset
    20
:: - DATE
hgs
parents:
diff changeset
    21
:: - TIME
hgs
parents:
diff changeset
    22
:: - TEMP
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
    26
:: Do the preparations:
hgs
parents:
diff changeset
    27
:: - Don't show the commands
hgs
parents:
diff changeset
    28
:: - Use local parameters -- don't pollute the global one
hgs
parents:
diff changeset
    29
:: - Dim the lights for time of script execution
hgs
parents:
diff changeset
    30
:: - Store the current working directory
hgs
parents:
diff changeset
    31
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
    32
hgs
parents:
diff changeset
    33
@echo off
hgs
parents:
diff changeset
    34
:: echo *** RUN_WST: START:
hgs
parents:
diff changeset
    35
setlocal
hgs
parents:
diff changeset
    36
color 08
hgs
parents:
diff changeset
    37
pushd .
hgs
parents:
diff changeset
    38
if not exist run_wst.bat goto INVALID_DIR
hgs
parents:
diff changeset
    39
hgs
parents:
diff changeset
    40
hgs
parents:
diff changeset
    41
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
    42
:: Set the local variables
hgs
parents:
diff changeset
    43
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
    44
hgs
parents:
diff changeset
    45
::echo *** RUN_WST: SET VARIABLES:
hgs
parents:
diff changeset
    46
set wst_root_dir=%cd%
hgs
parents:
diff changeset
    47
set wst_log_dir=%wst_root_dir%\wst_log
hgs
parents:
diff changeset
    48
set log_file=%wst_log_dir%\wst_log.txt
hgs
parents:
diff changeset
    49
set build_script=%wst_root_dir%\wst_script\wst_make.bat
hgs
parents:
diff changeset
    50
hgs
parents:
diff changeset
    51
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
    52
:: Check that script exists
hgs
parents:
diff changeset
    53
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
    54
hgs
parents:
diff changeset
    55
::echo *** RUN_WST: SOME CHECKS:
hgs
parents:
diff changeset
    56
if not exist %build_script% goto INVALID_DIR
hgs
parents:
diff changeset
    57
:: Create output directory if it does not exist
hgs
parents:
diff changeset
    58
if not exist %wst_log_dir% mkdir %wst_log_dir%
hgs
parents:
diff changeset
    59
:: Create log file
hgs
parents:
diff changeset
    60
echo *** WST_LOG: BEGIN *** > %log_file%
hgs
parents:
diff changeset
    61
hgs
parents:
diff changeset
    62
hgs
parents:
diff changeset
    63
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
    64
:: Check parameters
hgs
parents:
diff changeset
    65
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
    66
hgs
parents:
diff changeset
    67
set command=ERROR
hgs
parents:
diff changeset
    68
if [%1]==[] set command=CLEAN_OLD_FILES COMPILE_QTCONFIGUTILS COMPILE_TEST_CASES RUN_TEST_CASES GENERATE_REPORTS SHOW_RESULTS
hgs
parents:
diff changeset
    69
if [%1]==[CLEAN_OLD] set command=CLEAN_OLD_FILES
hgs
parents:
diff changeset
    70
if [%1]==[COMPILE] set command=COMPILE_QTCONFIGUTILS
hgs
parents:
diff changeset
    71
if [%1]==[CASES] set command=COMPILE_TEST_CASES
hgs
parents:
diff changeset
    72
if [%1]==[RUN] set command=RUN_TEST_CASES
hgs
parents:
diff changeset
    73
if [%1]==[REPORTS] set command=GENERATE_REPORTS
hgs
parents:
diff changeset
    74
if [%1]==[RESULTS] set command=SHOW_RESULTS
hgs
parents:
diff changeset
    75
if [%1]==[BROWSE] set command=START_BROWSER
hgs
parents:
diff changeset
    76
if [%1]==[/?] goto HELP
hgs
parents:
diff changeset
    77
if [%1]==[HELP] goto HELP
hgs
parents:
diff changeset
    78
if [%1]==[/h] goto HELP
hgs
parents:
diff changeset
    79
if [%1]==[-h] goto HELP
hgs
parents:
diff changeset
    80
hgs
parents:
diff changeset
    81
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
    82
:PARSE_COMMANDS
hgs
parents:
diff changeset
    83
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
    84
hgs
parents:
diff changeset
    85
:: echo *** RUN_WST: COMMAND: %command%
hgs
parents:
diff changeset
    86
:: echo *** RUN_WST: CALL SCRIPT:
hgs
parents:
diff changeset
    87
for %%i IN ( %command% ) DO (
hgs
parents:
diff changeset
    88
    call %build_script% %wst_root_dir% wst_log.txt %%i
hgs
parents:
diff changeset
    89
    for /f "tokens=3 delims= " %%x in ('find /C " Error " %log_file%') do (
hgs
parents:
diff changeset
    90
        if not [%%x]==[0] goto ERROR
hgs
parents:
diff changeset
    91
    )
hgs
parents:
diff changeset
    92
)
hgs
parents:
diff changeset
    93
hgs
parents:
diff changeset
    94
goto THE_END
hgs
parents:
diff changeset
    95
hgs
parents:
diff changeset
    96
hgs
parents:
diff changeset
    97
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
    98
:INVALID_DIR
hgs
parents:
diff changeset
    99
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
   100
hgs
parents:
diff changeset
   101
echo *** RUN_WST: INVALID DIR:
hgs
parents:
diff changeset
   102
echo *** Test script sub-script not found!
hgs
parents:
diff changeset
   103
echo *** Please be sure to run the script in same directory,
hgs
parents:
diff changeset
   104
echo *** i.e. .\run_wst.bat , and NOT .\wst\run_wst.bat
hgs
parents:
diff changeset
   105
hgs
parents:
diff changeset
   106
goto THE_END
hgs
parents:
diff changeset
   107
hgs
parents:
diff changeset
   108
hgs
parents:
diff changeset
   109
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
   110
:ERROR
hgs
parents:
diff changeset
   111
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
   112
hgs
parents:
diff changeset
   113
echo *** RUN_WST: ERROR:
hgs
parents:
diff changeset
   114
color 48
hgs
parents:
diff changeset
   115
echo Error in compilation:
hgs
parents:
diff changeset
   116
findstr /C:" Error " < %log_file%
hgs
parents:
diff changeset
   117
echo.
hgs
parents:
diff changeset
   118
Echo Quitting WST.
hgs
parents:
diff changeset
   119
hgs
parents:
diff changeset
   120
goto THE_END
hgs
parents:
diff changeset
   121
hgs
parents:
diff changeset
   122
hgs
parents:
diff changeset
   123
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
   124
:HELP
hgs
parents:
diff changeset
   125
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
   126
hgs
parents:
diff changeset
   127
echo *** RUN_WST: HELP:
hgs
parents:
diff changeset
   128
echo Run EAP Qt Configuration Utilities Workstation Testing
hgs
parents:
diff changeset
   129
echo.
hgs
parents:
diff changeset
   130
echo RUN_WST [param]
hgs
parents:
diff changeset
   131
echo.
hgs
parents:
diff changeset
   132
echo   param
hgs
parents:
diff changeset
   133
echo     [none]  - Do all, from CLEAN_OLD to RESULTS
hgs
parents:
diff changeset
   134
echo.
hgs
parents:
diff changeset
   135
echo     CLEAN_OLD - Clean metrics and other generated files
hgs
parents:
diff changeset
   136
echo     COMPILE - Build EAP QT configuration utilities (qtconfigutils)
hgs
parents:
diff changeset
   137
echo     CASES   - Build only Tester components
hgs
parents:
diff changeset
   138
echo     RUN     - Run Tester
hgs
parents:
diff changeset
   139
echo     REPORTS - Generate reports
hgs
parents:
diff changeset
   140
echo     RESULTS - Show results
hgs
parents:
diff changeset
   141
echo     BROWSE  - Start browser
hgs
parents:
diff changeset
   142
echo.
hgs
parents:
diff changeset
   143
hgs
parents:
diff changeset
   144
hgs
parents:
diff changeset
   145
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
   146
:THE_END
hgs
parents:
diff changeset
   147
::-----------------------------------------------------------------------------
hgs
parents:
diff changeset
   148
hgs
parents:
diff changeset
   149
echo *** RUN_WST: Completed:
hgs
parents:
diff changeset
   150
color
hgs
parents:
diff changeset
   151
popd