phonesettings/cpphonesettingsplugins/cptelephonyutils/tsrc/run_auto_tests_qt.bat
changeset 27 2f8f8080a020
parent 21 92ab7f8d0eab
child 51 f39ed5e045e0
equal deleted inserted replaced
22:6bb1b21d2484 27:2f8f8080a020
    30 ::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
    30 ::    "for /f %%a in ('dir /b ut_*') do call :build %%a"
    31 ::    which compiles, instruments and runs all test directories
    31 ::    which compiles, instruments and runs all test directories
    32 ::    starting with "ut_".
    32 ::    starting with "ut_".
    33 ::::::::::::::::::::::::::::::::::::::::::::::::::::::
    33 ::::::::::::::::::::::::::::::::::::::::::::::::::::::
    34 :DEFAULT
    34 :DEFAULT
    35 set TESTED_SRC=..\..\src\*
    35 set TESTED_SRC=..\..\src\*.cpp
    36 
    36 
    37 for /f %%a in ('dir /b ut_*') do call :build %%a
    37 for /f %%a in ('dir /b ut_*') do call :build %%a
    38 if [%DOMODULESTESTS%] EQU [TRUE] (
    38 if [%DOMODULESTESTS%] EQU [TRUE] (
    39 for /f %%a in ('dir /b mt_*') do call :build %%a
    39 for /f %%a in ('dir /b mt_*') do call :build %%a
    40 )
    40 )
    52 set BUILDTESTS=TRUE
    52 set BUILDTESTS=TRUE
    53 set RUNTESTS=TRUE
    53 set RUNTESTS=TRUE
    54 set INSTRUMENT=TRUE
    54 set INSTRUMENT=TRUE
    55 set REMOVEINSTRUMENT=TRUE
    55 set REMOVEINSTRUMENT=TRUE
    56 set DOMODULESTESTS=TRUE
    56 set DOMODULESTESTS=TRUE
    57 set ABLD_CALL=abld build winscw udeb -keepgoing
    57 set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD
    58 set PATH_TO_DLL=\epoc32\release\winscw\udeb
    58 set PATH_TO_DLL=\epoc32\release\winscw\udeb
    59 set PATH_TO_COVERAGE_DATA=\coverage_data
    59 set PATH_TO_COVERAGE_DATA=\coverage_data
       
    60 set PATH_TO_RESULT=\test_result
    60 
    61 
    61 if not exist %PATH_TO_COVERAGE_DATA% (
    62 if not exist %PATH_TO_COVERAGE_DATA% (
    62 mkdir %PATH_TO_COVERAGE_DATA%
    63 mkdir %PATH_TO_COVERAGE_DATA%
       
    64 )
       
    65 
       
    66 if not exist %PATH_TO_RESULT% (
       
    67 mkdir %PATH_TO_RESULT%
    63 )
    68 )
    64 
    69 
    65 if [%1] EQU [] ( goto default )
    70 if [%1] EQU [] ( goto default )
    66 
    71 
    67 call :%1
    72 call :%1
   130 )
   135 )
   131 
   136 
   132 pushd .
   137 pushd .
   133 call cd %1
   138 call cd %1
   134 call qmake
   139 call qmake
   135 call bldmake bldfiles
   140 call sbs --config winscw_udeb --keepgoing CLEAN
   136 call abld clean winscw udeb
       
   137 if [%INSTRUMENT%] EQU [TRUE] (
   141 if [%INSTRUMENT%] EQU [TRUE] (
   138 call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL%
   142 call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%"
   139 ) else (
   143 ) else (
   140 call %ABLD_CALL%
   144 call %SBS_CALL%
   141 )
   145 )
   142 
   146 
   143 popd
   147 popd
   144 endlocal
   148 endlocal
   145 goto end
   149 goto end
   150 ::
   154 ::
   151 :: NOTE! Function assumes that test binary is named according to test directory.
   155 :: NOTE! Function assumes that test binary is named according to test directory.
   152 ::::::::::::::::::::::::::::::::::::::::::::::::::::::
   156 ::::::::::::::::::::::::::::::::::::::::::::::::::::::
   153 :RUNTESTS
   157 :RUNTESTS
   154 echo Running tests
   158 echo Running tests
   155 for /f %%a in ('dir /b ut_*') do call %PATH_TO_DLL%\%%a.exe 
   159 for /f %%a in ('dir /b ut_*') do (
       
   160     call %PATH_TO_DLL%\%%a.exe
       
   161     move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log
       
   162 )
   156 goto end
   163 goto end
   157 
   164 
   158 ::::::::::::::::::::::::::::::::::::::::::::::::::::::
   165 ::::::::::::::::::::::::::::::::::::::::::::::::::::::
   159 :: function CALCULATECOVERAGE
   166 :: function CALCULATECOVERAGE
   160 ::
   167 ::