Skip to content

Commit bdfc64a

Browse files
committedJan 21, 2024
coverage: Add a test that uses #[bench]
1 parent cb25c5b commit bdfc64a

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed
 

‎tests/coverage/bench.cov-map

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Function name: bench::my_bench
2+
Raw bytes (9): 0x[01, 01, 00, 01, 01, 08, 01, 00, 27]
3+
Number of files: 1
4+
- file 0 => global file 1
5+
Number of expressions: 0
6+
Number of file 0 mappings: 1
7+
- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 39)
8+
9+
Function name: bench::my_bench::{closure#0}
10+
Raw bytes (9): 0x[01, 01, 00, 01, 01, 07, 01, 00, 09]
11+
Number of files: 1
12+
- file 0 => global file 1
13+
Number of expressions: 0
14+
Number of file 0 mappings: 1
15+
- Code(Counter(0)) at (prev + 7, 1) to (start + 0, 9)
16+

‎tests/coverage/bench.coverage

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
LL| |#![feature(test)]
2+
LL| |// edition: 2021
3+
LL| |// compile-flags: --test
4+
LL| |
5+
LL| |extern crate test;
6+
LL| |
7+
LL| 1|#[bench]
8+
LL| 1|fn my_bench(_b: &mut test::Bencher) {}
9+

‎tests/coverage/bench.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![feature(test)]
2+
// edition: 2021
3+
// compile-flags: --test
4+
5+
extern crate test;
6+
7+
#[bench]
8+
fn my_bench(_b: &mut test::Bencher) {}

0 commit comments

Comments
 (0)
Please sign in to comment.