test-all.bat 1.9 KB
Newer Older
wafwerar's avatar
wafwerar 已提交
1 2 3 4
@echo off
SETLOCAL EnableDelayedExpansion
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do     rem"') do (  set "DEL=%%a")
set /a a=0
wafwerar's avatar
wafwerar 已提交
5
echo Windows Taosd Test
wafwerar's avatar
wafwerar 已提交
6
for /F "usebackq tokens=*" %%i in (fulltest.bat) do (
7 8
    for /f "tokens=1* delims= " %%a in ("%%i") do if not "%%a" == "@REM" (
        echo Processing %%i
wafwerar's avatar
wafwerar 已提交
9 10 11
        call :GetTimeSeconds %time%
        set time1=!_timeTemp!
        echo Start at %time%
12
        set /a a+=1
wafwerar's avatar
wafwerar 已提交
13
        call %%i ARG1 > result_!a!.txt 2>error_!a!.txt
14 15
        if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && echo result: && cat result_!a!.txt && echo error: && cat error_!a!.txt && exit 8 ) else ( call :colorEcho 0a "Success" &echo. ) 
    )
wafwerar's avatar
wafwerar 已提交
16
)
wafwerar's avatar
wafwerar 已提交
17 18 19 20 21 22 23 24 25 26 27 28
@REM echo Linux Taosd Test
@REM for /F "usebackq tokens=*" %%i in (fulltest.bat) do (
@REM     for /f "tokens=1* delims= " %%a in ("%%i") do if not "%%a" == "@REM" (
@REM         echo Processing %%i
@REM         call :GetTimeSeconds %time%
@REM         set time1=!_timeTemp!
@REM         echo Start at %time%
@REM         set /a a+=1
@REM         call %%i ARG1 -m %1 > result_!a!.txt 2>error_!a!.txt
@REM         if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && echo result: && cat result_!a!.txt && echo error: && cat error_!a!.txt && exit 8 ) else ( call :colorEcho 0a "Success" &echo. ) 
@REM     )
@REM )
wafwerar's avatar
wafwerar 已提交
29 30 31
exit

:colorEcho
wafwerar's avatar
wafwerar 已提交
32 33 34 35
call :GetTimeSeconds %time%
set time2=%_timeTemp%
set /a interTime=%time2% - %time1%
echo End at %time% , cast %interTime%s
wafwerar's avatar
wafwerar 已提交
36 37 38
echo off
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
wafwerar's avatar
wafwerar 已提交
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
del "%~2" > nul 2>&1i
goto :eof

:GetTimeSeconds
set tt=%1
set tt=%tt:.= %
set tt=%tt::= %
set index=1
for %%a in (%tt%) do (
    if !index! EQU 1 (
        set hh=%%a
    )^
    else if  !index! EQU 2 (
        set mm=%%a
 
    )^
    else if  !index! EQU 3 (
        set ss=%%a
    )
   set /a index=index+1
)
set /a _timeTemp=(%hh%*60+%mm%)*60+%ss%
goto :eof