Required:
* Chocolatey
* Perl
* LCOV
-
Install choco
Run
Get-ExecutionPolicy. If it returns Restricted, then runSet-ExecutionPolicy AllSignedorSet-ExecutionPolicy Bypass -Scope Process- CMD (With Admin)
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
- POWERSHELL (With Admin)
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
-
Install Perl
choco install strawberryperl
-
Check Installed Perl
where perl
OUTPUT CORRECT:
# C:\Strawberry\perl\bin\perl.exeIf not exist, add path perl on system environment variables
Note: A command that changes cmd's environment variables only for the current cmd session
set PATH=$PATH:C:\Strawberry\perl\bin echo %path%
If want You can permanently add a path to PATH with the setx command:
Warnings
- Backup your PATH - SETX will truncate your junk longer than 1024 characters
- Don't call SETX %PATH%;xxx - adds the system path into the user path (SETX by default will update your user path.)
- Don't call SETX %PATH%;xxx /M - adds the user path into the system path (SETX ... /M will update your system path.)
setx /M path "%path%;C:\Strawberry\perl\bin\" echo %path%
-
Install LCOV
choco install lcov
-
Run tests of project Flutter
flutter test --coverage -
Generate coverage files and convert to HTML
CMD or PowerShell
perl C:\ProgramData\chocolatey\lib\lcov\tools\bin\genhtml coverage/lcov.info -o coverage/html
Git bash
perl /c/ProgramData/chocolatey/lib/lcov/tools/bin/genhtml coverage/lcov.info -o coverage/html