mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
No printing executable names when running benches with json message format
This commit is contained in:
parent
7952680d8d
commit
e04d7772e4
@ -53,7 +53,10 @@ pub fn run_benches(
|
|||||||
let compilation = compile_tests(ws, options)?;
|
let compilation = compile_tests(ws, options)?;
|
||||||
|
|
||||||
if options.no_run {
|
if options.no_run {
|
||||||
|
if !options.compile_opts.build_config.emit_json() {
|
||||||
display_no_run_information(ws, args, &compilation, "benches")?;
|
display_no_run_information(ws, args, &compilation, "benches")?;
|
||||||
|
}
|
||||||
|
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1216,6 +1216,39 @@ fn test_bench_no_run() {
|
|||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cargo_test]
|
||||||
|
fn test_bench_no_run_emit_json() {
|
||||||
|
if !is_nightly() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let p = project()
|
||||||
|
.file("src/lib.rs", "")
|
||||||
|
.file(
|
||||||
|
"benches/bbaz.rs",
|
||||||
|
r#"
|
||||||
|
#![feature(test)]
|
||||||
|
|
||||||
|
extern crate test;
|
||||||
|
|
||||||
|
use test::Bencher;
|
||||||
|
|
||||||
|
#[bench]
|
||||||
|
fn bench_baz(_: &mut Bencher) {}
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
p.cargo("bench --no-run --message-format json")
|
||||||
|
.with_stderr(
|
||||||
|
"\
|
||||||
|
[COMPILING] foo v0.0.1 ([..])
|
||||||
|
[FINISHED] bench [optimized] target(s) in [..]
|
||||||
|
",
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
#[cargo_test]
|
#[cargo_test]
|
||||||
fn test_bench_no_fail_fast() {
|
fn test_bench_no_fail_fast() {
|
||||||
if !is_nightly() {
|
if !is_nightly() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user