mweibel / lcov-result-merger

Merges multiple lcov results into one
MIT License
100 stars 22 forks source link

results of subdirectories should be prepended with the subdirectory path #44

Closed ened closed 2 years ago

ened commented 4 years ago

Given a repository directory structure like this, from a Flutter project:

lib/component.dart
test/component_test.dart
packages/module1/lib/module1.dart
packages/module1/test/module1_test.dart
packages/module2/lib/module2.dart
packages/module21/test/module2_test.dart

Then will run programs that generates the .lcov files first (in this case flutter test --coverage) and want to combine all the lcov.info files into a central overview.

I used lcov-result-merger '**/lcov.info' coverage/combined.info. That produced a valid file but discarded the relative path to the source files references in the sub directories, leading to genhtml errors like this:

❯ genhtml coverage/combined.info -o coverage/html    
...
genhtml: ERROR: cannot read /Users/user/git/com.company.app/lib/module1.dart

I think that lcov-result merger should try to adjust the subdirectory path to "module1.dart", so that genhtml tries to resolve packages/module1/lib/module1.dart instead.

mweibel commented 4 years ago

feel free to send a PR :)

mdeanjones commented 2 years ago

Long time coming @ened, but this should be resolved as of 3.3.0