]> git.lizzy.rs Git - rust.git/blob - src/test/ui/test-panic-abort-nocapture.rs
Merge commit '03f01bbe901d60b71cf2c5ec766aef5e532ab79d' into update_cg_clif-2020...
[rust.git] / src / test / ui / test-panic-abort-nocapture.rs
1 // no-prefer-dynamic
2 // compile-flags: --test -Cpanic=abort -Zpanic_abort_tests
3 // run-flags: --test-threads=1 --nocapture
4 // run-fail
5 // check-run-results
6 // exec-env:RUST_BACKTRACE=0
7
8 // ignore-wasm no panic or subprocess support
9 // ignore-emscripten no panic or subprocess support
10 // ignore-sgx no subprocess support
11
12 #![cfg(test)]
13
14 use std::io::Write;
15
16 #[test]
17 fn it_works() {
18     println!("about to succeed");
19     assert_eq!(1 + 1, 2);
20 }
21
22 #[test]
23 #[should_panic]
24 fn it_panics() {
25     println!("about to panic");
26     assert_eq!(1 + 1, 4);
27 }
28
29 #[test]
30 fn it_fails() {
31     println!("about to fail");
32     assert_eq!(1 + 1, 4);
33 }
34
35 #[test]
36 fn it_writes_to_stdio() {
37     println!("hello, world");
38     writeln!(std::io::stdout(), "testing123").unwrap();
39     writeln!(std::io::stderr(), "testing321").unwrap();
40 }