From: Takashi Sawanaka Date: Thu, 12 Aug 2021 13:43:06 +0000 (+0900) Subject: PerfTest.cmd: Add the measurement result to the CSV file X-Git-Tag: v2.16.15~91 X-Git-Url: http://git.osdn.net/view?p=winmerge-jp%2Fwinmerge-jp.git;a=commitdiff_plain;h=ea6a6340293eb38445e7e43d37bbaaf490ea2ed8 PerfTest.cmd: Add the measurement result to the CSV file --- diff --git a/Testing/PerfTest.cmd b/Testing/PerfTest.cmd index 80eb00398..4634ddeed 100644 --- a/Testing/PerfTest.cmd +++ b/Testing/PerfTest.cmd @@ -1,14 +1,16 @@ -set exepath=c:\progra~1\winmerge\winmergeu.exe -for /F "usebackq" %%f in (`powershell -command [System.Diagnostics.FileVersionInfo]::GetVersionInfo^('%exepath%'^).FileVersion`) do ( - set resultpath=%~dp0\result-%%f-%date:/=-%%time::=.%.txt +if "%1" == "" ( + set exepath=c:\progra~1\winmerge\winmergeu.exe +) else ( + set exepath=%1 ) -( - echo [MainFrame] - powershell -command $^(measure-command { cmd '/c for /L %%i in ^(1,1,10^) do "%exepath%" /noninteractive /noprefs' }^).TotalSeconds - echo [MergeEditFrame] - powershell -command $^(measure-command { cmd '/c for /L %%i in ^(1,1,10^) do "%exepath%" /noninteractive /noprefs c:\progra~1\winmerge\docs\readme.txt c:\progra~1\winmerge\docs\readme.txt' }^).TotalSeconds - echo [DirFrame] - powershell -command $^(measure-command { cmd '/c for /L %%i in ^(1,1,10^) do "%exepath%" /noninteractive /noprefs c:\progra~1\winmerge\docs\ c:\progra~1\winmerge\docs\' }^).TotalSeconds - echo [Report] - powershell -command $^(measure-command { cmd '/c %~dp0\ReportTest.cmd' }^).TotalSeconds -) > "%resultpath%" +if not exist %~dp0result.csv ( + echo Date,Version,MainFrame,MergeEditFrame,DirFrame,Report > "%~dp0result.csv" +) +for /F "usebackq" %%f in (`powershell -command [System.Diagnostics.FileVersionInfo]::GetVersionInfo^('%exepath%'^).FileVersion`) do set Version=%%f +for /F "usebackq" %%f in (`powershell -command $^(measure-command { cmd '/c for /L %%i in ^(1,1,10^) do "%exepath%" /noninteractive /noprefs' }^).TotalSeconds`) do set MainFrame=%%f +for /F "usebackq" %%f in (`powershell -command $^(measure-command { cmd '/c for /L %%i in ^(1,1,10^) do "%exepath%" /noninteractive /noprefs c:\progra~1\winmerge\docs\readme.txt c:\progra~1\winmerge\docs\readme.txt' }^).TotalSeconds`) do set MergeEditFrame=%%f +for /F "usebackq" %%f in (`powershell -command $^(measure-command { cmd '/c for /L %%i in ^(1,1,10^) do "%exepath%" /noninteractive /noprefs c:\progra~1\winmerge\docs\ c:\progra~1\winmerge\docs\' }^).TotalSeconds`) do set DirFrame=%%f +if "%Version:2.16=%" == "%Version%" goto :SKIP_REPORT +for /F "usebackq" %%f in (`powershell -command $^(measure-command { cmd '/c %~dp0\ReportTest.cmd' }^).TotalSeconds`) do set Report=%%f +:SKIP_REPORT +echo %date% %time%,%Version%,%MainFrame%,%MergeEditFrame%,%DirFrame%,%Report% >> "%~dp0result.csv"