]> git.lizzy.rs Git - rust.git/blob - benches/smoke.rs
Reorganize benches.
[rust.git] / benches / smoke.rs
1 #![feature(test, rustc_private)]
2
3 extern crate test;
4 use test::Bencher;
5 mod helpers;
6 use helpers::*;
7
8 #[bench]
9 fn noop(bencher: &mut Bencher) {
10     bencher.iter(|| {
11         smoke_helper::main();
12     })
13 }
14
15 /*
16 // really slow
17 #[bench]
18 fn noop_miri_full(bencher: &mut Bencher) {
19     let path = std::env::var("RUST_SYSROOT").expect("env variable `RUST_SYSROOT` not set");
20     bencher.iter(|| {
21         let mut process = std::process::Command::new("target/release/miri");
22         process.arg("benches/smoke_helper.rs")
23                .arg("--sysroot").arg(&path);
24         let output = process.output().unwrap();
25         if !output.status.success() {
26             println!("{}", String::from_utf8(output.stdout).unwrap());
27             println!("{}", String::from_utf8(output.stderr).unwrap());
28             panic!("failed to run miri");
29         }
30     })
31 }
32 */
33
34 #[bench]
35 fn noop_miri_interpreter(bencher: &mut Bencher) {
36     miri_helper::run("smoke_helper", bencher);
37 }