You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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 .
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
The text was updated successfully, but these errors were encountered:
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.
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 reportmy 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
The text was updated successfully, but these errors were encountered: