Skip to content

Commit

Permalink
coverage: Add a test that uses #[bench]
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalathar committed Jan 21, 2024
1 parent cb25c5b commit bdfc64a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/coverage/bench.cov-map
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Function name: bench::my_bench
Raw bytes (9): 0x[01, 01, 00, 01, 01, 08, 01, 00, 27]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 39)

Function name: bench::my_bench::{closure#0}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 07, 01, 00, 09]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 7, 1) to (start + 0, 9)

9 changes: 9 additions & 0 deletions tests/coverage/bench.coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
LL| |#![feature(test)]
LL| |// edition: 2021
LL| |// compile-flags: --test
LL| |
LL| |extern crate test;
LL| |
LL| 1|#[bench]
LL| 1|fn my_bench(_b: &mut test::Bencher) {}

8 changes: 8 additions & 0 deletions tests/coverage/bench.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![feature(test)]
// edition: 2021
// compile-flags: --test

extern crate test;

#[bench]
fn my_bench(_b: &mut test::Bencher) {}

0 comments on commit bdfc64a

Please sign in to comment.