wlanutilities/wlanwizard/t_wlanwizard/wst_script/wst_make.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 :: Following commands are implemented:
       
    19 :: - CLEAN_OLD_FILES
       
    20 :: - RUN_TEST_CASES
       
    21 :: - GENERATE_REPORTS
       
    22 :: - SHOW_RESULTS
       
    23 :: - START_BROWSER
       
    24 ::=============================================================================
       
    25 
       
    26 ::-----------------------------------------------------------------------------
       
    27 :: Do the preparations:
       
    28 :: - Don't show the commands
       
    29 :: - Use local parameters -- don't pollute the global one
       
    30 ::-----------------------------------------------------------------------------
       
    31 @echo off
       
    32 
       
    33 ::echo *** WST_MAKE: START:
       
    34 setlocal
       
    35 
       
    36 ::-----------------------------------------------------------------------------
       
    37 :: Check input
       
    38 :: 
       
    39 :: Parameters that are required:
       
    40 :: 1) wst_root_dir
       
    41 :: 2) log_file_name
       
    42 :: 3) the command
       
    43 ::-----------------------------------------------------------------------------
       
    44 
       
    45 :: (1)
       
    46 if not exist %1 goto ERROR
       
    47 if [%1]==[] goto ERROR
       
    48 set wst_root_dir=%1
       
    49 set wst_log_dir=%1\wst_log
       
    50 set wst_report_dir=%1\wst_report
       
    51 set wlanwizard_root_dir=%1\..
       
    52 set wlanwizard_test_dir=%1\
       
    53 
       
    54 :: (2)
       
    55 if [%2]==[] goto ERROR
       
    56 set log_file_name=%2
       
    57 set log_file=%wst_log_dir%\%log_file_name%
       
    58 if not exist %log_file% goto ERROR
       
    59 echo *** DATE AND TIME: %date%, %time% >> %log_file%
       
    60 ::echo *** WST_MAKE: INFO: WLAN Wizard root dir: %wlanwizard_root_dir%
       
    61 ::echo *** WST_MAKE: INFO: WLAN Wizard test dir: %wlanwizard_test_dir%
       
    62 ::echo *** WST_MAKE: INFO: WST log dir:             %wst_log_dir%
       
    63 ::echo *** WST_MAKE: INFO: WST log file:            %log_file%
       
    64 
       
    65 :: (3)
       
    66 if [%3]==[] goto ERROR
       
    67 goto %3
       
    68 
       
    69 :: Error if label not found.
       
    70 goto ERROR
       
    71 
       
    72 ::-----------------------------------------------------------------------------
       
    73 :CLEAN_OLD_FILES
       
    74 ::-----------------------------------------------------------------------------
       
    75 
       
    76 echo *** WST_MAKE: CLEAN_OLD_FILES:
       
    77 echo *** WST_LOG: CLEAN_OLD_FILES >> %log_file%
       
    78 
       
    79 move %wst_log_dir%\%log_file_name% %wst_root_dir%
       
    80 del /F /S /Q %wst_log_dir%\*
       
    81 del /F /S /Q %wst_report_dir%\*
       
    82 rmdir /S /Q %wst_log_dir%\CMTHTML
       
    83 rmdir /S /Q %wst_log_dir%\CTCHTML
       
    84 move %wst_root_dir%\%log_file_name% %wst_log_dir% 
       
    85 del \epoc32\winscw\c\data\wlanwizard_qtext_log.txt
       
    86 
       
    87 goto THE_END
       
    88 
       
    89 ::-----------------------------------------------------------------------------
       
    90 :COMPILE_TEST_CASES
       
    91 ::-----------------------------------------------------------------------------
       
    92 
       
    93 echo *** WST_MAKE: COMPILE_TEST_CASES:
       
    94 echo *** WST_LOG: COMPILE_TEST_CASES >> %log_file%
       
    95 
       
    96 cd %wlanwizard_test_dir%
       
    97 call sbs reallyclean >> %log_file% 2>&1
       
    98 call make distclean >> %log_file% 2>&1
       
    99 call qmake "CONFIG += coverage_test debug" >> %log_file% 2>&1
       
   100 call sbs -c winscw_udeb  >> %log_file% 2>&1
       
   101 :: Call CTC instrumentation script. Source directories hard coded, because NO_EXCLUDE does not like % characters...
       
   102 call ctcwrap -C EXCLUDE=* -C NO_EXCLUDE+..\src\*.cpp -2comp -n %wst_log_dir%\MON.sym -i d -v sbs -c winscw_udeb >> %log_file% 2>&1
       
   103 
       
   104 goto THE_END
       
   105 
       
   106 ::-----------------------------------------------------------------------------
       
   107 :RUN_TEST_CASES
       
   108 ::-----------------------------------------------------------------------------
       
   109 
       
   110 echo *** WST_MAKE: RUN_TEST_CASES:
       
   111 echo *** WST_LOG: RUN_TEST_CASES >> %log_file%
       
   112 
       
   113 call \epoc32\release\winscw\udeb\t_wlanwizard.exe -o c:\data\wlanwizard_qtext_log.txt
       
   114 
       
   115 goto THE_END
       
   116 
       
   117 ::-----------------------------------------------------------------------------
       
   118 :GENERATE_REPORTS
       
   119 ::-----------------------------------------------------------------------------
       
   120 
       
   121 echo *** WST_MAKE: GENERATE_REPORTS:
       
   122 echo *** WST_LOG: GENERATE_REPORTS >> %log_file%
       
   123 
       
   124 cd %wst_log_dir%
       
   125 
       
   126 call ctcpost -p %wst_log_dir%\ctc_coverage.txt
       
   127 call ctc2html -nsb -i %wst_log_dir%\ctc_coverage.txt
       
   128 
       
   129 call dir /s /b %wlanwizard_root_dir%\src\*.cpp > %wst_log_dir%\raw_filelist.txt
       
   130 
       
   131 call findstr /I /V "moc_" %wst_log_dir%\raw_filelist.txt > %wst_log_dir%\filelist.txt
       
   132 call cmt -f %wst_log_dir%\filelist.txt -o cmt_metrics.txt  >> %log_file%
       
   133 call cmt2html -nsb -i cmt_metrics.txt
       
   134 
       
   135 :: Clean up temp files
       
   136 call del %wst_log_dir%\*filelist.txt
       
   137 
       
   138 echo *** WST_MAKE: COPY LOGS:
       
   139 call copy %TEMP%\epocwind.out %wst_log_dir%\epocwind.txt
       
   140 
       
   141 goto THE_END
       
   142 
       
   143 ::-----------------------------------------------------------------------------
       
   144 :SHOW_RESULTS
       
   145 ::-----------------------------------------------------------------------------
       
   146 
       
   147 echo *** WST_MAKE: SHOW_RESULTS:
       
   148 echo *** WST_LOG: SHOW_RESULTS >> %log_file%
       
   149 echo *** Module tests:
       
   150 call findstr /C:"Totals: " \epoc32\winscw\c\data\wlanwizard_qtext_log.txt
       
   151 echo *** Coverage:
       
   152 call findstr /C:"Number of " %wst_log_dir%\ctc_coverage.txt
       
   153 call findstr /C:"TER       " %wst_log_dir%\ctc_coverage.txt
       
   154 
       
   155 goto THE_END 
       
   156 
       
   157 ::-----------------------------------------------------------------------------
       
   158 :START_BROWSER
       
   159 ::-----------------------------------------------------------------------------
       
   160 
       
   161 echo *** WST_MAKE: START_BROWSER:
       
   162 echo *** WST_LOG: START_BROWSER >> %log_file%
       
   163 echo.
       
   164 echo Starting up browser to show the results
       
   165 
       
   166 start %wst_root_dir%\wst_report\coverage.html
       
   167 
       
   168 goto THE_END
       
   169 
       
   170 ::-----------------------------------------------------------------------------
       
   171 :ERROR
       
   172 ::-----------------------------------------------------------------------------
       
   173 
       
   174 echo *** WST_MAKE: ERROR:
       
   175 endlocal
       
   176 echo wst_make *** Error (unknown parameter) >> %log_file%
       
   177 
       
   178 goto THE_END
       
   179 
       
   180 ::-----------------------------------------------------------------------------
       
   181 :THE_END
       
   182 ::-----------------------------------------------------------------------------
       
   183 :: echo *** WST_MAKE: END: