about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-13 19:03:27 +0000
committerbors <bors@rust-lang.org>2023-06-13 19:03:27 +0000
commit2445d740f741c9d0954822ef0f0cd0c2a1c6acd2 (patch)
treebae2f3ff46bbc14158a255e684a1667cba4a4cde
parentf8cde5884d94617044c8c40d24f9fe6f355fd73f (diff)
parent7886be6327772937d895c9738edb097b06d18b74 (diff)
Auto merge of #112314 - ferrocene:pa-core-alloc-abort, r=bjorn3
Ignore `core`, `alloc` and `test` tests that require unwinding on `-C panic=abort`

Some of the tests for `core` and `alloc` require unwinding through their use of `catch_unwind`. These tests fail when testing using `-C panic=abort` (in my case through a target without unwinding support, and `-Z panic-abort-tests`), while they should be ignored as they don't indicate a failure.

This PR marks all of these tests with this attribute:

```rust
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
```

I'm not aware of a way to test this on rust-lang/rust's CI, as we don't test any target with `-C panic=abort`, but I tested this locally on a Ferrocene target and it does indeed make the test suite pass.
-rw-r--r--patches/0023-coretests-Ignore-failing-tests.patch36
1 files changed, 0 insertions, 36 deletions
diff --git a/patches/0023-coretests-Ignore-failing-tests.patch b/patches/0023-coretests-Ignore-failing-tests.patch
index f2cb82751f0..385f5a8a2e0 100644
--- a/patches/0023-coretests-Ignore-failing-tests.patch
+++ b/patches/0023-coretests-Ignore-failing-tests.patch
@@ -10,42 +10,6 @@ Subject: [PATCH] [core] Ignore failing tests
  library/core/tests/time.rs       |  1 +
  4 files changed, 18 insertions(+), 2 deletions(-)
 
-diff --git a/array.rs b/array.rs
-index 4bc44e9..8e3c7a4 100644
---- a/array.rs
-+++ b/array.rs
-@@ -242,6 +242,7 @@ fn iterator_drops() {
-     assert_eq!(i.get(), 5);
- }
- 
-+/*
- // This test does not work on targets without panic=unwind support.
- // To work around this problem, test is marked is should_panic, so it will
- // be automagically skipped on unsuitable targets, such as
-@@ -283,6 +284,7 @@ fn array_default_impl_avoids_leaks_on_panic() {
-     assert_eq!(COUNTER.load(Relaxed), 0);
-     panic!("test succeeded")
- }
-+*/
- 
- #[test]
- fn empty_array_is_always_default() {
-@@ -304,6 +304,7 @@ fn array_map() {
-     assert_eq!(b, [1, 2, 3]);
- }
- 
-+/*
- // See note on above test for why `should_panic` is used.
- #[test]
- #[should_panic(expected = "test succeeded")]
-@@ -332,6 +333,7 @@ fn array_map_drop_safety() {
-     assert_eq!(DROPPED.load(Ordering::SeqCst), num_to_create);
-     panic!("test succeeded")
- }
-+*/
- 
- #[test]
- fn cell_allows_array_cycle() {
 diff --git a/atomic.rs b/atomic.rs
 index 13b12db..96fe4b9 100644
 --- a/atomic.rs