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