// running tests while providing a base that other test frameworks may
// build off of.
-// N.B., this is also specified in this crate's Cargo.toml, but librustc_ast contains logic specific to
-// this crate, which relies on this attribute (rather than the value of `--crate-name` passed by
-// cargo) to detect this crate.
-
-#![crate_name = "test"]
#![unstable(feature = "test", issue = "50297")]
#![doc(test(attr(deny(warnings))))]
#![feature(libc)]
.into_iter()
.map(|x| {
let testfn = match x.testfn {
- DynBenchFn(bench) => DynTestFn(Box::new(move || {
- bench::run_once(|b| __rust_begin_short_backtrace(|| bench.run(b)))
+ DynBenchFn(benchfn) => DynTestFn(Box::new(move || {
+ bench::run_once(|b| __rust_begin_short_backtrace(|| benchfn(b)))
})),
StaticBenchFn(benchfn) => DynTestFn(Box::new(move || {
bench::run_once(|b| __rust_begin_short_backtrace(|| benchfn(b)))
TestRunOpts { strategy, nocapture: opts.nocapture, concurrency, time: opts.time_options };
match testfn {
- DynBenchFn(bencher) => {
+ DynBenchFn(benchfn) => {
// Benchmarks aren't expected to panic, so we run them all in-process.
- crate::bench::benchmark(id, desc, monitor_ch, opts.nocapture, |harness| {
- bencher.run(harness)
- });
+ crate::bench::benchmark(id, desc, monitor_ch, opts.nocapture, benchfn);
None
}
StaticBenchFn(benchfn) => {