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