mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
add tests on running benchmarks with -Z panic-abort-tests
This commit is contained in:
parent
b82eb28224
commit
142f453758
@ -11,9 +11,13 @@
|
||||
// ignore-sgx no subprocess support
|
||||
|
||||
#![cfg(test)]
|
||||
#![feature(test)]
|
||||
|
||||
extern crate test;
|
||||
|
||||
use std::io::Write;
|
||||
use std::env;
|
||||
use test::Bencher;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
@ -48,3 +52,8 @@ fn no_residual_environment() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn benchmark(b: &mut Bencher) {
|
||||
b.iter(|| assert_eq!(1 + 1, 2));
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
|
||||
running 5 tests
|
||||
running 6 tests
|
||||
test benchmark ... ok
|
||||
test it_exits ... FAILED
|
||||
test it_fails ... FAILED
|
||||
test it_panics - should panic ... ok
|
||||
@ -18,7 +19,7 @@ testing123
|
||||
testing321
|
||||
thread 'main' panicked at 'assertion failed: `(left == right)`
|
||||
left: `2`,
|
||||
right: `5`', $DIR/test-panic-abort.rs:34:5
|
||||
right: `5`', $DIR/test-panic-abort.rs:38:5
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
||||
|
||||
@ -26,5 +27,5 @@ failures:
|
||||
it_exits
|
||||
it_fails
|
||||
|
||||
test result: FAILED. 3 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
test result: FAILED. 4 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user