File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -1688,3 +1688,40 @@ error: unexpected argument `--keep-going` found
1688
1688
. with_status ( 101 )
1689
1689
. run ( ) ;
1690
1690
}
1691
+
1692
+ #[ cargo_test( nightly, reason = "bench" ) ]
1693
+ fn cargo_bench_print_env_verbose ( ) {
1694
+ let p = project ( )
1695
+ . file ( "Cargo.toml" , & basic_manifest ( "foo" , "0.0.1" ) )
1696
+ . file (
1697
+ "src/main.rs" ,
1698
+ r#"
1699
+ #![feature(test)]
1700
+ #[cfg(test)]
1701
+ extern crate test;
1702
+
1703
+ fn hello() -> &'static str {
1704
+ "hello"
1705
+ }
1706
+
1707
+ pub fn main() {
1708
+ println!("{}", hello())
1709
+ }
1710
+
1711
+ #[bench]
1712
+ fn bench_hello(_b: &mut test::Bencher) {
1713
+ assert_eq!(hello(), "hello")
1714
+ }
1715
+ "# ,
1716
+ )
1717
+ . build ( ) ;
1718
+ p. cargo ( "bench -vv" )
1719
+ . with_stderr (
1720
+ "\
1721
+ [COMPILING] foo v0.0.1 ([CWD])
1722
+ [RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustc[..]`
1723
+ [FINISHED] bench [optimized] target(s) in [..]
1724
+ [RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] [CWD]/target/release/deps/foo-[..][EXE] --bench`" ,
1725
+ )
1726
+ . run ( ) ;
1727
+ }
You can’t perform that action at this time.
0 commit comments