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