dart-lang / tools

This repository is home to tooling related Dart packages.
BSD 3-Clause "New" or "Revised" License
30 stars 23 forks source link

Coverage doesn't include branch and function information? #478

Closed Hixie closed 2 years ago

Hixie commented 3 years ago

When I run flutter test --coverage and then lcov --summary coverage/lcov.info, it says functions: no data found and branches: no data found. I'm no expert but that would seem to suggest that the lcov.info format now supports more than we are currently exposing.

IchordeDionysos commented 3 years ago

Yes, coverage information in an LCOV file can include the number of

Especially, the last one can be very helpful when you want to ensure that every single part of the application is tested and to make sure that someone does not miss the else part of an if statement during the tests!

Here is a bit of documentation on the file format which explains how this works in the LCOV file format: http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php

I would very much appreciate having branch coverage! 💪 (Function coverage is not so important for us)

liamappelbe commented 2 years ago

Dupe of https://github.com/dart-lang/tools/issues/575