4

I'm write a unit test for my flutter project. Next, i'm run test by command:

flutter test --coverage

This command run the test and create lcov.info file with coverage data.

SF:lib\cc_tracker.dart
DA:5,0
DA:7,2
DA:9,2
DA:11,2
DA:12,2
LF:5
LH:4
end_of_record
SF:lib\cc_data.dart
DA:2,0
LF:1
LH:0
end_of_record
SF:lib\cc_list.dart
DA:8,2
DA:10,2
DA:17,2
DA:19,2
DA:20,2
DA:23,2
DA:24,2
DA:25,2
DA:28,2
DA:29,0
DA:30,2
DA:35,2
DA:36,4
DA:37,4
DA:38,0
DA:39,0
DA:40,0
DA:41,0
DA:43,0
DA:44,0
DA:45,0
DA:47,0
DA:49,0
DA:50,0
DA:55,2
DA:56,4
DA:57,0
DA:58,0
DA:59,0
DA:60,0
DA:62,0
DA:63,2
DA:66,2
DA:68,2
DA:69,2
LF:35
LH:19
end_of_record

Does everyone convert it in practice to html report on windows environment?

In theory, there is a perl scripts (lcov.perl, genhtml.perl, ...). But genhtml isn't working on windows powershell. Its generate output in coverage/html/index.html:

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       10.03.2020     16:34                -p
d-----       10.03.2020     16:34                root
-a----       11.03.2020     19:03            141 amber.png
-a----       11.03.2020     19:03            141 emerald.png
-a----       11.03.2020     19:03          10404 gcov.css
-a----       11.03.2020     19:03            167 glass.png
-a----       10.03.2020     16:34           4236 index-sort-b.html
-a----       10.03.2020     16:34           4236 index-sort-f.html
-a----       10.03.2020     16:34           4236 index-sort-l.html
-a----       10.03.2020     16:34           4243 index.html
-a----       11.03.2020     19:03            141 ruby.png
-a----       11.03.2020     19:03            141 snow.png
-a----       11.03.2020     19:03            117 updown.png

But content of report is empty:

enter image description here

Please, let me practical advice to this problem. Thanks!

Sergio Belevskij
  • 2,478
  • 25
  • 24

1 Answers1

0

On Windows: Try to replace backslash character ("\") with slash character ("/") in all file path lines (prefixed with "SF:") in the lcov.info file and then run genhtml.perl script. It should help (It helped me, at least).

lekbern
  • 21
  • 2