Description
llvm-cov report
llvm-cov report
merges metrics for instantiations with the strategy "Take max(covered)/max(num) for each instantance".
- Line (and region): Each instance may have different number of records, due to skipped regions by instantiation-time constants. This sometimes confuses the strategy
max/max
. - Branch and MC/DC: Due to folded conditions, the result might show false negative with the strategy "max/max".
llvm-cov show
Source view
The merged counters can be seen in Line (and region) counters. They show max counters in each record. I think this will be less informative if any instances are not fully covered on their own.
Branches and MC/DC records are not merged in the source view. It is noisy. Actual uncovered branches should be found in instantiation subviews.
Anyways, the source view doesn't reflect the summary. (see also #119282)
Possible merge strategies
Planning. It should be better if merged result can be seen in the source view. llvm-cov
will accept one of strategies below by command line options.
They below are listed in order of tolerance.
Count up after merging records
- Line (and region): Skipped lines will be filled.
- Branch: Folded conditions will be dissolved.
- MC/DC: Discovers more independence pairs by merging test vectors. (This will require moving
findIndependencePairs
deferred)
I think:
- For the coverage of the complex codebase (e.g. LLVM), merging records will be more practical.
- For local scope non-template functions (static inline functions in header files), merging records should be the best.
Max(any)
This assumes harderning the current strategy. Show "covered" if one of instantiations is fully covered.
This might be confused in skipped/folded stuff.
Min(all)
This actually means, "Don't merge, just count up each instance". The template will be "not covered at all" if at least one instantiation is not executed.