runTest_SV.bat 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. @echo off
  2. set UVEXE=C:\Keil_v5\UV4\UV4.EXE
  3. if .%1==. goto help
  4. for %%a in (ARM GCC ARMCLANG) do if %1==%%a goto checkParam2
  5. echo parameter %1 not supported.
  6. goto help
  7. :checkParam2
  8. if .%2==. goto help
  9. for %%a in ( ^
  10. cortexM0l ^
  11. cortexM3l ^
  12. cortexM4l ^
  13. cortexM4lf ^
  14. cortexM7l ^
  15. cortexM7lfsp ^
  16. cortexM7lfdp ^
  17. ARMv8MBLl ^
  18. ARMv8MMLl ^
  19. ARMv8MMLlfsp ^
  20. ARMv8MMLlfdp ^
  21. ARMv8MMLld ^
  22. ARMv8MMLldfsp ^
  23. ARMv8MMLldfdp ^
  24. ) do if %2==%%a goto checkParam3
  25. echo parameter %2 not supported.
  26. goto help
  27. :checkParam3
  28. if .%3==. goto help
  29. for %%a in (MPS2 FVP Simulator) do if %3==%%a goto buildProject
  30. echo parameter %3 not supported.
  31. goto help
  32. :buildProject
  33. echo Build Test Project ...
  34. %UVEXE% -r -j0 .\DspLibTest_SV_%3\%1\DspLibTest_%3.uvprojx -t "%2" -o ".\Logs\DspLibTest_%3_%2_build.log"
  35. echo Run Test ...
  36. del /Q ".\DspLibTest_SV_%3\%1\Logs\DspLibTest_%3.log" 2>NUL
  37. del /Q ".\DspLibTest_SV_%3\%1\Logs\DspLibTest_%3_%2.log" 2>NUL
  38. rem get start time (The format of %TIME% is HH:MM:SS,CS for example 23:59:59,99)
  39. set STARTTIME=%TIME%
  40. rem run the test
  41. %UVEXE% -d .\DspLibTest_SV_%3\%1\DspLibTest_%3.uvprojx -t "%2"
  42. rem get end time
  43. set ENDTIME=%TIME%
  44. rem calculate duration
  45. rem Change formatting for the start and end times
  46. for /F "tokens=1-4 delims=:.," %%a in ("%STARTTIME%") do (
  47. set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
  48. )
  49. for /F "tokens=1-4 delims=:.," %%a in ("%ENDTIME%") do (
  50. set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
  51. )
  52. rem Test midnight rollover. If so, add 1 day=8640000 1/100ths secs
  53. if %end% lss %start% set /a end+=8640000
  54. rem Calculate the elapsed time by subtracting values
  55. set /A elapsed=end-start
  56. rem Format the results for output
  57. set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
  58. if %hh% lss 10 set hh=0%hh%
  59. if %mm% lss 10 set mm=0%mm%
  60. if %ss% lss 10 set ss=0%ss%
  61. if %cc% lss 10 set cc=0%cc%
  62. set DURATION=%hh%:%mm%:%ss%,%cc%
  63. rem write time to file
  64. echo Test %1 %2 : > ".\DspLibTest_SV_%3\%1\Logs\DspLibTest_%3_%2_time.log"
  65. echo Start time: %STARTTIME% >> ".\DspLibTest_SV_%3\%1\Logs\DspLibTest_%3_%2_time.log"
  66. echo End time: %ENDTIME% >> ".\DspLibTest_SV_%3\%1\Logs\DspLibTest_%3_%2_time.log"
  67. echo Duration: %DURATION% >> ".\DspLibTest_SV_%3\%1\Logs\DspLibTest_%3_%2_time.log"
  68. echo Copy Logfile ...
  69. copy /B ".\DspLibTest_SV_%3\%1\Logs\DspLibTest_%3.log" ".\DspLibTest_SV_%3\%1\Logs\DspLibTest_%3_%2.log"
  70. goto end
  71. :help
  72. echo.
  73. echo Syntax: runTest toolchain core test
  74. echo.
  75. echo toolchain: ARM ^| ARMCLANG ^| GCC
  76. echo core: cortexM0l ^| cortexM3l ^| cortexM4l ^| cortexM4lf ^| cortexM7l ^| cortexM7lfsp ^| cortexM7lfdp
  77. echo ARMv8MBLl
  78. echo ARMv8MMLl ^| ARMv8MMLlfsp ^| ARMv8MMLlfdp
  79. echo ARMv8MMLld ^| ARMv8MMLldfsp ^| ARMv8MMLldfdp
  80. echo test: MPS2 ^| FVP ^| Simulator
  81. echo.
  82. echo e.g.: runTest ARM cortexM3l Simulator
  83. :end
  84. @echo on