From b77bcd7e741c0a79d7b367e1bc3f16b907263ed4 Mon Sep 17 00:00:00 2001 From: Chris Wailes Date: Thu, 19 Jan 2023 14:30:08 -0800 Subject: Disable unwinding tests when using panic-abort Test: atest tokio_test_test_sync_watch Test: atest tokio_test_test_sync_broadcast Bug: 262591027 Bug: 266004212 Change-Id: I3041faddb216329248b277328bc9958b14e8e04b --- patches/panic_unwind_tests.patch | 24 ++++++++++++++++++++++++ tests/sync_broadcast.rs | 1 + tests/sync_watch.rs | 1 + 3 files changed, 26 insertions(+) create mode 100644 patches/panic_unwind_tests.patch diff --git a/patches/panic_unwind_tests.patch b/patches/panic_unwind_tests.patch new file mode 100644 index 0000000..adf431e --- /dev/null +++ b/patches/panic_unwind_tests.patch @@ -0,0 +1,24 @@ +diff --git a/tests/sync_broadcast.rs b/tests/sync_broadcast.rs +index 9aa3484..53ee7d8 100644 +--- a/tests/sync_broadcast.rs ++++ b/tests/sync_broadcast.rs +@@ -292,6 +292,7 @@ fn capacity_too_big() { + + #[test] ++#[cfg(panic = "unwind")] + #[cfg(not(tokio_wasm))] // wasm currently doesn't support unwinding + fn panic_in_clone() { + use std::panic::{self, AssertUnwindSafe}; + +diff --git a/tests/sync_watch.rs b/tests/sync_watch.rs +index 34f9b78..e8eacce 100644 +--- a/tests/sync_watch.rs ++++ b/tests/sync_watch.rs +@@ -214,6 +214,7 @@ fn reopened_after_subscribe() { + + #[test] ++#[cfg(panic = "unwind")] + #[cfg(not(tokio_wasm))] // wasm currently doesn't support unwinding + fn send_modify_panic() { + let (tx, mut rx) = watch::channel("one"); + diff --git a/tests/sync_broadcast.rs b/tests/sync_broadcast.rs index 9aa3484..2221fe3 100644 --- a/tests/sync_broadcast.rs +++ b/tests/sync_broadcast.rs @@ -291,6 +291,7 @@ fn capacity_too_big() { } #[test] +#[cfg(panic = "unwind")] #[cfg(not(tokio_wasm))] // wasm currently doesn't support unwinding fn panic_in_clone() { use std::panic::{self, AssertUnwindSafe}; diff --git a/tests/sync_watch.rs b/tests/sync_watch.rs index 34f9b78..d4f8ce8 100644 --- a/tests/sync_watch.rs +++ b/tests/sync_watch.rs @@ -213,6 +213,7 @@ fn reopened_after_subscribe() { } #[test] +#[cfg(panic = "unwind")] #[cfg(not(tokio_wasm))] // wasm currently doesn't support unwinding fn send_modify_panic() { let (tx, mut rx) = watch::channel("one"); -- cgit v1.2.3