wlanutilities/wlanwizard/t_wlanwizard/run_wst.bat
changeset 31 e8f4211554fb
equal deleted inserted replaced
30:ab513c8439db 31:e8f4211554fb
       
     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 
       
    52 ::-----------------------------------------------------------------------------
       
    53 :: Check that script exists
       
    54 ::-----------------------------------------------------------------------------
       
    55 
       
    56 ::echo *** RUN_WST: SOME CHECKS:
       
    57 if not exist %build_script% goto INVALID_DIR
       
    58 :: Create output directory if it does not exist
       
    59 if not exist %wst_log_dir% mkdir %wst_log_dir%
       
    60 if not exist %wst_report_dir% mkdir %wst_report_dir%
       
    61 :: Create log file
       
    62 echo *** WST_LOG: BEGIN *** > %log_file%
       
    63 
       
    64 
       
    65 ::-----------------------------------------------------------------------------
       
    66 :: Check parameters
       
    67 ::-----------------------------------------------------------------------------
       
    68 
       
    69 set command=ERROR
       
    70 if [%1]==[] set command=CLEAN_OLD_FILES COMPILE_TEST_CASES RUN_TEST_CASES GENERATE_REPORTS SHOW_RESULTS
       
    71 if [%1]==[CLEAN_OLD] set command=CLEAN_OLD_FILES
       
    72 if [%1]==[CASES] set command=COMPILE_TEST_CASES
       
    73 if [%1]==[RUN] set command=RUN_TEST_CASES
       
    74 if [%1]==[REPORTS] set command=GENERATE_REPORTS
       
    75 if [%1]==[RESULTS] set command=SHOW_RESULTS
       
    76 if [%1]==[BROWSE] set command=START_BROWSER
       
    77 if [%1]==[/?] goto HELP
       
    78 if [%1]==[HELP] goto HELP
       
    79 if [%1]==[/h] goto HELP
       
    80 if [%1]==[-h] goto HELP
       
    81 
       
    82 ::-----------------------------------------------------------------------------
       
    83 :PARSE_COMMANDS
       
    84 ::-----------------------------------------------------------------------------
       
    85 
       
    86 :: echo *** RUN_WST: COMMAND: %command%
       
    87 :: echo *** RUN_WST: CALL SCRIPT:
       
    88 for %%i IN ( %command% ) DO (
       
    89     call %build_script% %wst_root_dir% wst_log.txt %%i
       
    90     for /f "tokens=3 delims= " %%x in ('find /C " Error " %log_file%') do (
       
    91         if not [%%x]==[0] goto ERROR
       
    92     )
       
    93 )
       
    94 
       
    95 goto THE_END
       
    96 
       
    97 
       
    98 ::-----------------------------------------------------------------------------
       
    99 :INVALID_DIR
       
   100 ::-----------------------------------------------------------------------------
       
   101 
       
   102 echo *** RUN_WST: INVALID DIR:
       
   103 echo *** Test script sub-script not found!
       
   104 echo *** Please be sure to run the script in same directory,
       
   105 echo *** i.e. .\run_wst.bat , and NOT .\wst\run_wst.bat
       
   106 
       
   107 goto THE_END
       
   108 
       
   109 
       
   110 ::-----------------------------------------------------------------------------
       
   111 :ERROR
       
   112 ::-----------------------------------------------------------------------------
       
   113 
       
   114 echo *** RUN_WST: ERROR:
       
   115 color 48
       
   116 echo Error in compilation:
       
   117 findstr /C:" Error " < %log_file%
       
   118 echo.
       
   119 Echo Quitting WST.
       
   120 
       
   121 goto THE_END
       
   122 
       
   123 
       
   124 ::-----------------------------------------------------------------------------
       
   125 :HELP
       
   126 ::-----------------------------------------------------------------------------
       
   127 
       
   128 echo *** RUN_WST: HELP:
       
   129 echo Run Wlan Qt Utilities Workstation Testing
       
   130 echo.
       
   131 echo RUN_WST [param]
       
   132 echo.
       
   133 echo   param
       
   134 echo     [none]  - Do all, from CLEAN_OLD to RESULTS
       
   135 echo.
       
   136 echo     CLEAN_OLD - Clean metrics and other generated files
       
   137 echo     CASES   - Build only Tester components
       
   138 echo     RUN     - Run Tester
       
   139 echo     REPORTS - Generate reports
       
   140 echo     RESULTS - Show results
       
   141 echo     BROWSE  - Start browser
       
   142 echo.
       
   143 
       
   144 
       
   145 ::-----------------------------------------------------------------------------
       
   146 :THE_END
       
   147 ::-----------------------------------------------------------------------------
       
   148 
       
   149 echo *** RUN_WST: Completed:
       
   150 color
       
   151 popd