coverage: Enable branch coverage in the branch coverage tests
This commit is contained in:
parent
31d0b50178
commit
5fb1f61a77
12 changed files with 295 additions and 139 deletions
|
@ -1,6 +1,6 @@
|
|||
LL| |#![feature(coverage_attribute)]
|
||||
LL| |//@ edition: 2021
|
||||
LL| |
|
||||
LL| |//@ compile-flags: -Zcoverage-options=branch
|
||||
LL| |//@ llvm-cov-flags: --show-branches=count
|
||||
LL| |
|
||||
LL| |macro_rules! no_merge {
|
||||
|
@ -18,9 +18,15 @@
|
|||
LL| 1| }
|
||||
LL| 3| Some(x) if x % 2 == 0 => {
|
||||
^2
|
||||
------------------
|
||||
| Branch (LL:20): [True: 2, False: 1]
|
||||
------------------
|
||||
LL| 2| println!("is nonzero and even");
|
||||
LL| 2| }
|
||||
LL| 1| Some(x) if x % 3 == 0 => {
|
||||
------------------
|
||||
| Branch (LL:20): [True: 1, False: 0]
|
||||
------------------
|
||||
LL| 1| println!("is nonzero and odd, but divisible by 3");
|
||||
LL| 1| }
|
||||
LL| 0| _ => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue