|
13 | 13 | // running tests while providing a base that other test frameworks may
|
14 | 14 | // build off of.
|
15 | 15 |
|
16 |
| -// N.B., this is also specified in this crate's Cargo.toml, but librustc_ast contains logic specific to |
17 |
| -// this crate, which relies on this attribute (rather than the value of `--crate-name` passed by |
18 |
| -// cargo) to detect this crate. |
19 |
| - |
20 |
| -#![crate_name = "test"] |
21 | 16 | #![unstable(feature = "test", issue = "50297")]
|
22 | 17 | #![doc(test(attr(deny(warnings))))]
|
23 |
| -#![feature(libc)] |
24 |
| -#![feature(rustc_private)] |
25 | 18 | #![feature(nll)]
|
26 | 19 | #![feature(available_parallelism)]
|
27 | 20 | #![feature(bench_black_box)]
|
28 | 21 | #![feature(internal_output_capture)]
|
29 |
| -#![feature(panic_unwind)] |
30 | 22 | #![feature(staged_api)]
|
31 | 23 | #![feature(termination_trait_lib)]
|
32 | 24 | #![feature(test)]
|
@@ -444,8 +436,8 @@ pub fn convert_benchmarks_to_tests(tests: Vec<TestDescAndFn>) -> Vec<TestDescAnd
|
444 | 436 | .into_iter()
|
445 | 437 | .map(|x| {
|
446 | 438 | let testfn = match x.testfn {
|
447 |
| - DynBenchFn(bench) => DynTestFn(Box::new(move || { |
448 |
| - bench::run_once(|b| __rust_begin_short_backtrace(|| bench.run(b))) |
| 439 | + DynBenchFn(benchfn) => DynTestFn(Box::new(move || { |
| 440 | + bench::run_once(|b| __rust_begin_short_backtrace(|| benchfn(b))) |
449 | 441 | })),
|
450 | 442 | StaticBenchFn(benchfn) => DynTestFn(Box::new(move || {
|
451 | 443 | bench::run_once(|b| __rust_begin_short_backtrace(|| benchfn(b)))
|
@@ -544,11 +536,9 @@ pub fn run_test(
|
544 | 536 | TestRunOpts { strategy, nocapture: opts.nocapture, concurrency, time: opts.time_options };
|
545 | 537 |
|
546 | 538 | match testfn {
|
547 |
| - DynBenchFn(bencher) => { |
| 539 | + DynBenchFn(benchfn) => { |
548 | 540 | // Benchmarks aren't expected to panic, so we run them all in-process.
|
549 |
| - crate::bench::benchmark(id, desc, monitor_ch, opts.nocapture, |harness| { |
550 |
| - bencher.run(harness) |
551 |
| - }); |
| 541 | + crate::bench::benchmark(id, desc, monitor_ch, opts.nocapture, benchfn); |
552 | 542 | None
|
553 | 543 | }
|
554 | 544 | StaticBenchFn(benchfn) => {
|
|
0 commit comments