diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2019-09-19 19:33:38 -0700 |
|---|---|---|
| committer | Tyler Mandry <tmandry@gmail.com> | 2019-09-28 13:52:18 -0700 |
| commit | 3f0254e3cf7656bd3726372106e98532b1575e2d (patch) | |
| tree | e2cf06f66e1845663d511f82b70a9b90093e5ad4 /src/test | |
| parent | 88376842a0592937bb807c8ec7a685946db96ea7 (diff) | |
Put panic=abort test support behind -Z panic_abort_tests
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/panic-runtime/libtest-unwinds.rs | 10 | ||||
| -rw-r--r-- | src/test/ui/panic-runtime/libtest-unwinds.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/test-panic-abort-disabled.rs | 20 | ||||
| -rw-r--r-- | src/test/ui/test-panic-abort-disabled.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/test-panic-abort.rs | 2 |
5 files changed, 25 insertions, 15 deletions
diff --git a/src/test/ui/panic-runtime/libtest-unwinds.rs b/src/test/ui/panic-runtime/libtest-unwinds.rs deleted file mode 100644 index bc13072612a..00000000000 --- a/src/test/ui/panic-runtime/libtest-unwinds.rs +++ /dev/null @@ -1,10 +0,0 @@ -// error-pattern:is not compiled with this crate's panic strategy `abort` -// compile-flags:-C panic=abort -// ignore-wasm32-bare compiled with panic=abort by default - -#![feature(test)] - -extern crate test; - -fn main() { -} diff --git a/src/test/ui/panic-runtime/libtest-unwinds.stderr b/src/test/ui/panic-runtime/libtest-unwinds.stderr deleted file mode 100644 index 704b81ae1ce..00000000000 --- a/src/test/ui/panic-runtime/libtest-unwinds.stderr +++ /dev/null @@ -1,4 +0,0 @@ -error: the linked panic runtime `panic_unwind` is not compiled with this crate's panic strategy `abort` - -error: aborting due to previous error - diff --git a/src/test/ui/test-panic-abort-disabled.rs b/src/test/ui/test-panic-abort-disabled.rs new file mode 100644 index 00000000000..f24046ff0e8 --- /dev/null +++ b/src/test/ui/test-panic-abort-disabled.rs @@ -0,0 +1,20 @@ +// error-pattern:building tests with panic=abort is not yet supported +// no-prefer-dynamic +// compile-flags: --test -Cpanic=abort +// run-flags: --test-threads=1 + +// ignore-wasm no panic or subprocess support +// ignore-emscripten no panic or subprocess support + +#![cfg(test)] + +#[test] +fn it_works() { + assert_eq!(1 + 1, 2); +} + +#[test] +#[should_panic] +fn it_panics() { + assert_eq!(1 + 1, 4); +} diff --git a/src/test/ui/test-panic-abort-disabled.stderr b/src/test/ui/test-panic-abort-disabled.stderr new file mode 100644 index 00000000000..a8d9bad43ed --- /dev/null +++ b/src/test/ui/test-panic-abort-disabled.stderr @@ -0,0 +1,4 @@ +error: building tests with panic=abort is not yet supported + +error: aborting due to previous error + diff --git a/src/test/ui/test-panic-abort.rs b/src/test/ui/test-panic-abort.rs index b77bb78b4b1..415ecbf7b38 100644 --- a/src/test/ui/test-panic-abort.rs +++ b/src/test/ui/test-panic-abort.rs @@ -1,5 +1,5 @@ // no-prefer-dynamic -// compile-flags: --test -Cpanic=abort +// compile-flags: --test -Cpanic=abort -Zpanic_abort_tests // run-flags: --test-threads=1 // run-fail // check-run-results |
