wlanutilities/wlanqtutilities/wst/run_wst.bat
changeset 43 72ebcbb64834
parent 39 7b3e49e4608a
child 49 fb81b597edf1
equal deleted inserted replaced
39:7b3e49e4608a 43:72ebcbb64834
     1 ::=============================================================================
       
     2 :: Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 :: All rights reserved.
       
     4 :: This component and the accompanying materials are made available
       
     5 :: under the terms of "Eclipse Public License v1.0"
       
     6 :: which accompanies this distribution, and is available
       
     7 :: at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 ::
       
     9 :: Initial Contributors:
       
    10 :: Nokia Corporation - initial contribution.
       
    11 ::
       
    12 :: Contributors:
       
    13 ::
       
    14 :: Description:
       
    15 ::
       
    16 ::=============================================================================
       
    17 
       
    18 :: Script(s) uses following environment settings:
       
    19 :: - CD
       
    20 :: - DATE
       
    21 :: - TIME
       
    22 :: - TEMP
       
    23 
       
    24 
       
    25 ::-----------------------------------------------------------------------------
       
    26 :: Do the preparations:
       
    27 :: - Don't show the commands
       
    28 :: - Use local parameters -- don't pollute the global one
       
    29 :: - Dim the lights for time of script execution
       
    30 :: - Store the current working directory
       
    31 ::-----------------------------------------------------------------------------
       
    32 
       
    33 @echo off
       
    34 echo *** RUN_WST: START:
       
    35 setlocal
       
    36 color 08
       
    37 pushd .
       
    38 if not exist run_wst.bat goto INVALID_DIR
       
    39 
       
    40 
       
    41 ::-----------------------------------------------------------------------------
       
    42 :: Set the local variables
       
    43 ::-----------------------------------------------------------------------------
       
    44 
       
    45 echo *** RUN_WST: SET VARIABLES:
       
    46 set wst_root_dir=%cd%
       
    47 set wst_log_dir=%wst_root_dir%\wst_log
       
    48 set wst_report_dir=%wst_root_dir%\wst_report
       
    49 set log_file=%wst_log_dir%\wst_log.txt
       
    50 set build_script=%wst_root_dir%\wst_script\wst_make.bat
       
    51 set epoc_commsdat_dir=\epoc32\winscw\c\private\10202be9\persists
       
    52 if not exist %epoc_commsdat_dir% goto INVALID_DIR
       
    53 set epoc_backup_dir=%epoc_commsdat_dir%\backup
       
    54 set ut_commsdat_dir=%wst_root_dir%\..\ut\context\commsdat_files
       
    55 if not exist %ut_commsdat_dir% goto INVALID_DIR
       
    56 set ut_commsdat_file_default=%ut_commsdat_dir%\default.cre
       
    57 if not exist %ut_commsdat_file_default% goto INVALID_DIR
       
    58 set ut_commsdat_files=%ut_commsdat_dir%\*.cre
       
    59 if not exist %ut_commsdat_files% goto INVALID_DIR
       
    60 
       
    61 
       
    62 ::-----------------------------------------------------------------------------
       
    63 :: Copy commsdat file to emulator directory and also to backup directory
       
    64 ::-----------------------------------------------------------------------------
       
    65 
       
    66 echo *** RUN_WST: COPY FILES:
       
    67 copy %ut_commsdat_file_default% %epoc_commsdat_dir%\cccccc00.cre /y
       
    68 if not exist %epoc_backup_dir% mkdir %epoc_backup_dir%
       
    69 copy %ut_commsdat_files% %epoc_backup_dir% /y
       
    70 
       
    71 
       
    72 ::-----------------------------------------------------------------------------
       
    73 :: Check that script exists
       
    74 ::-----------------------------------------------------------------------------
       
    75 
       
    76 echo *** RUN_WST: SOME CHECKS:
       
    77 if not exist %build_script% goto INVALID_DIR
       
    78 :: Create output directory if it does not exist
       
    79 if not exist %wst_log_dir% mkdir %wst_log_dir%
       
    80 if not exist %wst_report_dir% mkdir %wst_report_dir%
       
    81 :: Create log file
       
    82 echo *** WST_LOG: BEGIN *** > %log_file%
       
    83 
       
    84 
       
    85 ::-----------------------------------------------------------------------------
       
    86 :: Check parameters
       
    87 ::-----------------------------------------------------------------------------
       
    88 
       
    89 set command=ERROR
       
    90 if [%1]==[] set command=CLEAN_OLD_FILES COMPILE_WLANQTUTILS COMPILE_TEST_CASES RUN_TEST_CASES GENERATE_REPORTS SHOW_RESULTS
       
    91 if [%1]==[CLEAN_OLD] set command=CLEAN_OLD_FILES
       
    92 if [%1]==[WLANQTUTILS] set command=COMPILE_WLANQTUTILS
       
    93 if [%1]==[CASES] set command=COMPILE_TEST_CASES
       
    94 if [%1]==[RUN] set command=RUN_TEST_CASES
       
    95 if [%1]==[REPORTS] set command=GENERATE_REPORTS
       
    96 if [%1]==[RESULTS] set command=SHOW_RESULTS
       
    97 if [%1]==[BROWSE] set command=START_BROWSER
       
    98 if [%1]==[/?] goto HELP
       
    99 if [%1]==[HELP] goto HELP
       
   100 if [%1]==[/h] goto HELP
       
   101 if [%1]==[-h] goto HELP
       
   102 
       
   103 ::-----------------------------------------------------------------------------
       
   104 :PARSE_COMMANDS
       
   105 ::-----------------------------------------------------------------------------
       
   106 
       
   107 echo *** RUN_WST: COMMAND: %command%
       
   108 echo *** RUN_WST: CALL SCRIPT:
       
   109 for %%i IN ( %command% ) DO (
       
   110     call %build_script% %wst_root_dir% wst_log.txt %%i
       
   111     for /f "tokens=3 delims= " %%x in ('find /C " Error " %log_file%') do (
       
   112         if not [%%x]==[0] goto ERROR
       
   113     )
       
   114 )
       
   115 
       
   116 goto THE_END
       
   117 
       
   118 
       
   119 ::-----------------------------------------------------------------------------
       
   120 :INVALID_DIR
       
   121 ::-----------------------------------------------------------------------------
       
   122 
       
   123 echo *** RUN_WST: INVALID DIR:
       
   124 echo *** Test script sub-script not found!
       
   125 echo *** Please be sure to run the script in same directory,
       
   126 echo *** i.e. .\run_wst.bat , and NOT .\wst\run_wst.bat
       
   127 
       
   128 goto THE_END
       
   129 
       
   130 
       
   131 ::-----------------------------------------------------------------------------
       
   132 :ERROR
       
   133 ::-----------------------------------------------------------------------------
       
   134 
       
   135 echo *** RUN_WST: ERROR:
       
   136 color 48
       
   137 echo Error in compilation:
       
   138 findstr /C:" Error " < %log_file%
       
   139 echo.
       
   140 Echo Quitting WST.
       
   141 
       
   142 goto THE_END
       
   143 
       
   144 
       
   145 ::-----------------------------------------------------------------------------
       
   146 :HELP
       
   147 ::-----------------------------------------------------------------------------
       
   148 
       
   149 echo *** RUN_WST: HELP:
       
   150 echo Run Wlan Qt Utilities Workstation Testing
       
   151 echo.
       
   152 echo RUN_WST [param]
       
   153 echo.
       
   154 echo   param
       
   155 echo     [none]  - Do all, from CLEAN_OLD to RESULTS
       
   156 echo.
       
   157 echo     CLEAN_OLD - Clean metrics and other generated files
       
   158 echo     WLANQTUTILS - Build only Wlan Qt Utilities components
       
   159 echo     CASES   - Build only Tester components
       
   160 echo     RUN     - Run Tester
       
   161 echo     REPORTS - Generate reports
       
   162 echo     RESULTS - Show results
       
   163 echo     BROWSE  - Start browser
       
   164 echo.
       
   165 
       
   166 
       
   167 ::-----------------------------------------------------------------------------
       
   168 :THE_END
       
   169 ::-----------------------------------------------------------------------------
       
   170 
       
   171 echo *** RUN_WST: END:
       
   172 color
       
   173 popd