1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
--- tests/sharded_lock.rs
+++ tests/sharded_lock.rs
@@ -46,6 +46,8 @@ fn frob() {
}
#[test]
+// Android aborts on panic and this test relies on stack unwinding.
+#[cfg(not(target_os = "android"))]
fn arc_poison_wr() {
let arc = Arc::new(ShardedLock::new(1));
let arc2 = arc.clone();
@@ -58,6 +60,8 @@ fn arc_poison_wr() {
}
#[test]
+// Android aborts on panic and this test relies on stack unwinding.
+#[cfg(not(target_os = "android"))]
fn arc_poison_ww() {
let arc = Arc::new(ShardedLock::new(1));
assert!(!arc.is_poisoned());
@@ -72,6 +76,8 @@ fn arc_poison_ww() {
}
#[test]
+// Android aborts on panic and this test relies on stack unwinding.
+#[cfg(not(target_os = "android"))]
fn arc_no_poison_rr() {
let arc = Arc::new(ShardedLock::new(1));
let arc2 = arc.clone();
@@ -84,6 +90,8 @@ fn arc_no_poison_rr() {
assert_eq!(*lock, 1);
}
#[test]
+// Android aborts on panic and this test relies on stack unwinding.
+#[cfg(not(target_os = "android"))]
fn arc_no_poison_sl() {
let arc = Arc::new(ShardedLock::new(1));
let arc2 = arc.clone();
@@ -135,6 +143,8 @@ fn arc() {
}
#[test]
+// Android aborts on panic and this test relies on stack unwinding.
+#[cfg(not(target_os = "android"))]
fn arc_access_in_unwind() {
let arc = Arc::new(ShardedLock::new(1));
let arc2 = arc.clone();
@@ -211,6 +221,8 @@ fn test_into_inner_drop() {
}
#[test]
+// Android aborts on panic and this test relies on stack unwinding.
+#[cfg(not(target_os = "android"))]
fn test_into_inner_poison() {
let m = Arc::new(ShardedLock::new(NonCopy(10)));
let m2 = m.clone();
@@ -235,6 +247,8 @@ fn test_get_mut() {
}
#[test]
+// Android aborts on panic and this test relies on stack unwinding.
+#[cfg(not(target_os = "android"))]
fn test_get_mut_poison() {
let m = Arc::new(ShardedLock::new(NonCopy(10)));
let m2 = m.clone();
--- tests/thread.rs
+++ tests/thread.rs
@@ -9,6 +9,8 @@ const THREADS: usize = 10;
const SMALL_STACK_SIZE: usize = 20;
#[test]
+// Android aborts on panic and this test relies on stack unwinding.
+#[cfg(not(target_os = "android"))]
fn join() {
let counter = AtomicUsize::new(0);
thread::scope(|scope| {
@@ -64,6 +66,8 @@ fn counter_builder() {
}
#[test]
+// Android aborts on panic and this test relies on stack unwinding.
+#[cfg(not(target_os = "android"))]
fn counter_panic() {
let counter = AtomicUsize::new(0);
let result = thread::scope(|scope| {
@@ -84,6 +88,8 @@ fn counter_panic() {
}
#[test]
+// Android aborts on panic and this test relies on stack unwinding.
+#[cfg(not(target_os = "android"))]
fn panic_twice() {
let result = thread::scope(|scope| {
scope.spawn(|_| {
@@ -108,6 +114,8 @@ fn panic_twice() {
}
#[test]
+// Android aborts on panic and this test relies on stack unwinding.
+#[cfg(not(target_os = "android"))]
fn panic_many() {
let result = thread::scope(|scope| {
scope.spawn(|_| panic!("deliberate panic #1"));
|