Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch mismatch #42

Open
rinick opened this issue Aug 16, 2018 · 0 comments
Open

Branch mismatch #42

rinick opened this issue Aug 16, 2018 · 0 comments

Comments

@rinick
Copy link

rinick commented Aug 16, 2018

I use nyc to test nodejs and karma-typescript to test browser and merge the result with lcov-result-merger.
the line coverage report is correct, but the branch coverage report are not

there are 2 issues.

  1. nyc block id starts with 0 : BRDA:29,0,0,8, but karma-typescript starts with 1 : BRDA:29,1,0,8. so they are completely mismatched and creates lots of extra branches in the report
  2. different compiling setting may cause some branch to disappear due to compiler optimization, so 2 report might have different number of branches, and in that case block id are also mismatched.

my work around is to unify block id base on the current source line instead of current source file, so every time BRDA reach a new source line, it reset block id to 0 .

my script to unify the block id:
https://github.com/ticlo/ticlo/blob/master/tool/unify-lcov.ts

this should solve most of the issues.
I guess it's still possible that even in same line, one compiling setting may finds 3 branches and the other finds only 2 branches. in that case it's just impossible to merge correctly since lcov doesn't have the information of the begin and end of a branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant