@@ -364,7 +364,7 @@ fn cargo_bench_failing_test() {
364
364
365
365
#[bench]
366
366
fn bench_hello(_b: &mut test::Bencher) {
367
- assert_eq!(hello(), "nope")
367
+ assert_eq!(hello(), "nope", "NOPE!" )
368
368
}
369
369
"# ,
370
370
)
@@ -389,28 +389,7 @@ hello
389
389
[ERROR] bench failed, to rerun pass `--bin foo`
390
390
391
391
"# ] ] )
392
- . with_stdout_data ( str![ [ r#"
393
-
394
- running 1 test
395
- test bench_hello ... FAILED
396
-
397
- failures:
398
-
399
- ---- bench_hello stdout ----
400
- thread 'main' panicked at src/main.rs:15:17:
401
- assertion `left == right` failed
402
- left: "hello"
403
- right: "nope"
404
- [NOTE] run with `RUST_BACKTRACE=1` environment variable to display a backtrace
405
-
406
-
407
- failures:
408
- bench_hello
409
-
410
- test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in [ELAPSED]s
411
-
412
-
413
- "# ] ] )
392
+ . with_stdout_data ( "...\n [..]NOPE![..]\n ..." )
414
393
. with_status ( 101 )
415
394
. run ( ) ;
416
395
}
@@ -1439,7 +1418,7 @@ fn test_bench_no_fail_fast() {
1439
1418
1440
1419
#[bench]
1441
1420
fn bench_nope(_b: &mut test::Bencher) {
1442
- assert_eq!("nope", hello())
1421
+ assert_eq!("nope", hello(), "NOPE!" )
1443
1422
}
1444
1423
"# ,
1445
1424
)
@@ -1449,7 +1428,7 @@ fn test_bench_no_fail_fast() {
1449
1428
#![feature(test)]
1450
1429
extern crate test;
1451
1430
#[bench]
1452
- fn b1_fail(_b: &mut test::Bencher) { assert_eq!(1, 2); }
1431
+ fn b1_fail(_b: &mut test::Bencher) { assert_eq!(1, 2, "ONE=TWO" ); }
1453
1432
"# ,
1454
1433
)
1455
1434
. build ( ) ;
@@ -1468,48 +1447,15 @@ fn test_bench_no_fail_fast() {
1468
1447
`--bench b1`
1469
1448
1470
1449
"# ] ] )
1471
- . with_stdout_data ( str![ [ r#"
1472
-
1473
- running 2 tests
1474
- test bench_hello ... bench: [AVG_ELAPSED] ns/iter (+/- [JITTER])
1475
- test bench_nope ... FAILED
1476
-
1477
- failures:
1478
-
1479
- ---- bench_nope stdout ----
1480
- thread 'main' panicked at src/main.rs:20:17:
1481
- assertion `left == right` failed
1482
- left: "nope"
1483
- right: "hello"
1484
- [NOTE] run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1485
-
1486
-
1487
- failures:
1488
- bench_nope
1489
-
1490
- test result: FAILED. 0 passed; 1 failed; 0 ignored; 1 measured; 0 filtered out; finished in [ELAPSED]s
1491
-
1492
-
1493
- running 1 test
1494
- test b1_fail ... FAILED
1495
-
1496
- failures:
1497
-
1498
- ---- b1_fail stdout ----
1499
- thread 'main' panicked at benches/b1.rs:5:54:
1500
- assertion `left == right` failed
1501
- left: 1
1502
- right: 2
1503
- [NOTE] run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1504
-
1505
-
1506
- failures:
1507
- b1_fail
1508
-
1509
- test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in [ELAPSED]s
1510
-
1511
-
1512
- "# ] ] )
1450
+ . with_stdout_data (
1451
+ r#"
1452
+ ...
1453
+ [..]NOPE![..]
1454
+ ...
1455
+ [..]ONE=TWO[..]
1456
+ ...
1457
+ "# ,
1458
+ )
1513
1459
. run ( ) ;
1514
1460
}
1515
1461
0 commit comments