Skip to main content

detect_all_benchmarks

Function detect_all_benchmarks 

Source
pub fn detect_all_benchmarks(crate_dir: &Path, crate_name: &str) -> Vec<String>
Available on crate feature full only.
Expand description

Detects all benchmark functions in a crate by scanning src/lib.rs for #[benchmark]

This function looks for functions marked with the #[benchmark] attribute and returns all found in the format {crate_name}::{function_name}.

§Arguments

  • crate_dir - Path to the crate directory containing Cargo.toml
  • crate_name - Name of the crate (used as prefix for the function names)

§Returns

A vector of benchmark function names in format crate_name::function_name