Skip to content

Commit 558f11a

Browse files
committed
Remove a bunch of emscripten test ignores
They are either outdated as emscripten now supports i128 or they are subsumed by #[cfg_attr(not(panic = "unwind"), ignore]
1 parent 2b9f32e commit 558f11a

File tree

11 files changed

+29
-59
lines changed

11 files changed

+29
-59
lines changed

alloc/tests/collections/binary_heap.rs

-2
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,7 @@ fn test_retain_catch_unwind() {
502502
// even if the order might not be correct.
503503
//
504504
// Destructors must be called exactly once per element.
505-
// FIXME: re-enable emscripten once it can unwind again
506505
#[test]
507-
#[cfg(not(target_os = "emscripten"))]
508506
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
509507
fn panic_safe() {
510508
use std::cmp;

alloc/tests/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ fn test_rng() -> rand_xorshift::XorShiftRng {
9393
rand::SeedableRng::from_seed(seed)
9494
}
9595

96-
// FIXME: Instantiated functions with i128 in the signature is not supported in Emscripten.
97-
// See https://github.com/kripken/emscripten-fastcomp/issues/169
98-
#[cfg(not(target_os = "emscripten"))]
9996
#[test]
10097
fn test_boxed_hasher() {
10198
let ordinary_hash = hash(&5u32);

alloc/tests/slice.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,6 @@ fn test_box_slice_clone() {
14141414

14151415
#[test]
14161416
#[allow(unused_must_use)] // here, we care about the side effects of `.clone()`
1417-
#[cfg_attr(target_os = "emscripten", ignore)]
14181417
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
14191418
fn test_box_slice_clone_panics() {
14201419
use std::sync::Arc;

alloc/tests/vec.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1587,9 +1587,7 @@ fn extract_if_complex() {
15871587
}
15881588
}
15891589

1590-
// FIXME: re-enable emscripten once it can unwind again
15911590
#[test]
1592-
#[cfg(not(target_os = "emscripten"))]
15931591
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
15941592
fn extract_if_consumed_panic() {
15951593
use std::rc::Rc;
@@ -1640,9 +1638,7 @@ fn extract_if_consumed_panic() {
16401638
}
16411639
}
16421640

1643-
// FIXME: Re-enable emscripten once it can catch panics
16441641
#[test]
1645-
#[cfg(not(target_os = "emscripten"))]
16461642
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
16471643
fn extract_if_unconsumed_panic() {
16481644
use std::rc::Rc;

core/tests/hash/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ fn test_custom_state() {
141141
// const { assert!(hash(&Custom { hash: 6 }) == 6) };
142142
}
143143

144-
// FIXME: Instantiated functions with i128 in the signature is not supported in Emscripten.
145-
// See https://github.com/kripken/emscripten-fastcomp/issues/169
146-
#[cfg(not(target_os = "emscripten"))]
147144
#[test]
148145
fn test_indirect_hasher() {
149146
let mut hasher = MyHasher { hash: 0 };

core/tests/num/flt2dec/random.rs

-6
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ where
8484
F: for<'a> FnMut(&Decoded, &'a mut [MaybeUninit<u8>]) -> Option<(&'a [u8], i16)>,
8585
G: for<'a> FnMut(&Decoded, &'a mut [MaybeUninit<u8>]) -> (&'a [u8], i16),
8686
{
87-
if cfg!(target_os = "emscripten") {
88-
return; // using rng pulls in i128 support, which doesn't work
89-
}
9087
let mut rng = crate::test_rng();
9188
let f32_range = Uniform::new(0x0000_0001u32, 0x7f80_0000);
9289
iterate("f32_random_equivalence_test", k, n, f, g, |_| {
@@ -100,9 +97,6 @@ where
10097
F: for<'a> FnMut(&Decoded, &'a mut [MaybeUninit<u8>]) -> Option<(&'a [u8], i16)>,
10198
G: for<'a> FnMut(&Decoded, &'a mut [MaybeUninit<u8>]) -> (&'a [u8], i16),
10299
{
103-
if cfg!(target_os = "emscripten") {
104-
return; // using rng pulls in i128 support, which doesn't work
105-
}
106100
let mut rng = crate::test_rng();
107101
let f64_range = Uniform::new(0x0000_0000_0000_0001u64, 0x7ff0_0000_0000_0000);
108102
iterate("f64_random_equivalence_test", k, n, f, g, |_| {

core/tests/num/ops.rs

+29-23
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ macro_rules! test_op {
5151
};
5252
}
5353

54-
test_op!(test_neg_defined, Neg::neg(0), 0, i8, i16, i32, i64, f32, f64);
55-
#[cfg(not(target_os = "emscripten"))]
56-
test_op!(test_neg_defined_128, Neg::neg(0), 0, i128);
54+
test_op!(test_neg_defined, Neg::neg(0), 0, i8, i16, i32, i64, i128, f32, f64);
5755

5856
test_op!(test_not_defined_bool, Not::not(true), false, bool);
5957

@@ -69,17 +67,17 @@ macro_rules! test_arith_op {
6967
i16,
7068
i32,
7169
i64,
70+
i128,
7271
isize,
7372
u8,
7473
u16,
7574
u32,
7675
u64,
76+
u128,
7777
usize,
7878
f32,
7979
f64
8080
);
81-
#[cfg(not(target_os = "emscripten"))]
82-
impls_defined!($op, $method($lhs, $rhs), 0, i128, u128);
8381
}
8482
};
8583
($fn_name:ident, $op:ident::$method:ident(&mut $lhs:literal, $rhs:literal)) => {
@@ -93,17 +91,17 @@ macro_rules! test_arith_op {
9391
i16,
9492
i32,
9593
i64,
94+
i128,
9695
isize,
9796
u8,
9897
u16,
9998
u32,
10099
u64,
100+
u128,
101101
usize,
102102
f32,
103103
f64
104104
);
105-
#[cfg(not(target_os = "emscripten"))]
106-
impls_defined!($op, $method(&mut $lhs, $rhs), 0, i128, u128);
107105
}
108106
};
109107
}
@@ -131,15 +129,15 @@ macro_rules! test_bitop {
131129
i16,
132130
i32,
133131
i64,
132+
i128,
134133
isize,
135134
u8,
136135
u16,
137136
u32,
138137
u64,
138+
u128,
139139
usize
140140
);
141-
#[cfg(not(target_os = "emscripten"))]
142-
impls_defined!($op, $method(0, 0), 0, i128, u128);
143141
impls_defined!($op, $method(false, false), false, bool);
144142
}
145143
};
@@ -156,15 +154,15 @@ macro_rules! test_bitop_assign {
156154
i16,
157155
i32,
158156
i64,
157+
i128,
159158
isize,
160159
u8,
161160
u16,
162161
u32,
163162
u64,
163+
u128,
164164
usize
165165
);
166-
#[cfg(not(target_os = "emscripten"))]
167-
impls_defined!($op, $method(&mut 0, 0), 0, i128, u128);
168166
impls_defined!($op, $method(&mut false, false), false, bool);
169167
}
170168
};
@@ -182,9 +180,11 @@ macro_rules! test_shift_inner {
182180
$(impl_defined!($op, $method(0,0), 0, $lt, $rt);)+
183181
};
184182
($op:ident::$method:ident, $lt:ty) => {
185-
test_shift_inner!($op::$method, $lt, i8, i16, i32, i64, isize, u8, u16, u32, u64, usize);
186-
#[cfg(not(target_os = "emscripten"))]
187-
test_shift_inner!($op::$method, $lt, i128, u128);
183+
test_shift_inner!(
184+
$op::$method, $lt,
185+
i8, i16, i32, i64, i128, isize,
186+
u8, u16, u32, u64, u128, usize
187+
);
188188
};
189189
}
190190

@@ -195,9 +195,11 @@ macro_rules! test_shift {
195195
($test_name:ident, $op:ident::$method:ident) => {
196196
#[test]
197197
fn $test_name() {
198-
test_shift!($op::$method, i8, i16, i32, i64, isize, u8, u16, u32, u64, usize);
199-
#[cfg(not(target_os = "emscripten"))]
200-
test_shift!($op::$method, i128, u128);
198+
test_shift!(
199+
$op::$method,
200+
i8, i16, i32, i64, i128, isize,
201+
u8, u16, u32, u64, u128, usize
202+
);
201203
}
202204
};
203205
}
@@ -207,9 +209,11 @@ macro_rules! test_shift_assign_inner {
207209
$(impl_defined!($op, $method(&mut 0,0), 0, $lt, $rt);)+
208210
};
209211
($op:ident::$method:ident, $lt:ty) => {
210-
test_shift_assign_inner!($op::$method, $lt, i8, i16, i32, i64, isize, u8, u16, u32, u64, usize);
211-
#[cfg(not(target_os = "emscripten"))]
212-
test_shift_assign_inner!($op::$method, $lt, i128, u128);
212+
test_shift_assign_inner!(
213+
$op::$method, $lt,
214+
i8, i16, i32, i64, i128, isize,
215+
u8, u16, u32, u64, u128, usize
216+
);
213217
};
214218
}
215219

@@ -220,9 +224,11 @@ macro_rules! test_shift_assign {
220224
($test_name:ident, $op:ident::$method:ident) => {
221225
#[test]
222226
fn $test_name() {
223-
test_shift_assign!($op::$method, i8, i16, i32, i64, isize, u8, u16, u32, u64, usize);
224-
#[cfg(not(target_os = "emscripten"))]
225-
test_shift_assign!($op::$method, i128, u128);
227+
test_shift_assign!(
228+
$op::$method,
229+
i8, i16, i32, i64, i128, isize,
230+
u8, u16, u32, u64, u128, usize
231+
);
226232
}
227233
};
228234
}

core/tests/num/wrapping.rs

-2
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,12 @@ wrapping_test!(test_wrapping_i8, i8, i8::MIN, i8::MAX);
6464
wrapping_test!(test_wrapping_i16, i16, i16::MIN, i16::MAX);
6565
wrapping_test!(test_wrapping_i32, i32, i32::MIN, i32::MAX);
6666
wrapping_test!(test_wrapping_i64, i64, i64::MIN, i64::MAX);
67-
#[cfg(not(target_os = "emscripten"))]
6867
wrapping_test!(test_wrapping_i128, i128, i128::MIN, i128::MAX);
6968
wrapping_test!(test_wrapping_isize, isize, isize::MIN, isize::MAX);
7069
wrapping_test!(test_wrapping_u8, u8, u8::MIN, u8::MAX);
7170
wrapping_test!(test_wrapping_u16, u16, u16::MIN, u16::MAX);
7271
wrapping_test!(test_wrapping_u32, u32, u32::MIN, u32::MAX);
7372
wrapping_test!(test_wrapping_u64, u64, u64::MIN, u64::MAX);
74-
#[cfg(not(target_os = "emscripten"))]
7573
wrapping_test!(test_wrapping_u128, u128, u128::MIN, u128::MAX);
7674
wrapping_test!(test_wrapping_usize, usize, usize::MIN, usize::MAX);
7775

std/src/f64/tests.rs

-3
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ fn test_neg_zero() {
112112
assert_eq!(Fp::Zero, neg_zero.classify());
113113
}
114114

115-
#[cfg_attr(all(target_arch = "wasm32", target_os = "emscripten"), ignore)] // issue 42630
116115
#[test]
117116
fn test_one() {
118117
let one: f64 = 1.0f64;
@@ -165,7 +164,6 @@ fn test_is_finite() {
165164
assert!((-109.2f64).is_finite());
166165
}
167166

168-
#[cfg_attr(all(target_arch = "wasm32", target_os = "emscripten"), ignore)] // issue 42630
169167
#[test]
170168
fn test_is_normal() {
171169
let nan: f64 = f64::NAN;
@@ -183,7 +181,6 @@ fn test_is_normal() {
183181
assert!(!1e-308f64.is_normal());
184182
}
185183

186-
#[cfg_attr(all(target_arch = "wasm32", target_os = "emscripten"), ignore)] // issue 42630
187184
#[test]
188185
fn test_classify() {
189186
let nan: f64 = f64::NAN;

std/src/io/tests.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use crate::mem::MaybeUninit;
77
use crate::ops::Deref;
88

99
#[test]
10-
#[cfg_attr(target_os = "emscripten", ignore)]
1110
fn read_until() {
1211
let mut buf = Cursor::new(&b"12"[..]);
1312
let mut v = Vec::new();
@@ -359,7 +358,6 @@ fn chain_zero_length_read_is_not_eof() {
359358
}
360359

361360
#[bench]
362-
#[cfg_attr(target_os = "emscripten", ignore)]
363361
#[cfg_attr(miri, ignore)] // Miri isn't fast...
364362
fn bench_read_to_end(b: &mut test::Bencher) {
365363
b.iter(|| {

test/src/tests.rs

-10
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ fn ignored_tests_result_in_ignored() {
133133
assert_eq!(result, TrIgnored);
134134
}
135135

136-
// FIXME: Re-enable emscripten once it can catch panics again (introduced by #65251)
137136
#[test]
138-
#[cfg(not(target_os = "emscripten"))]
139137
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
140138
fn test_should_panic() {
141139
fn f() -> Result<(), String> {
@@ -164,9 +162,7 @@ fn test_should_panic() {
164162
assert_eq!(result, TrOk);
165163
}
166164

167-
// FIXME: Re-enable emscripten once it can catch panics again (introduced by #65251)
168165
#[test]
169-
#[cfg(not(target_os = "emscripten"))]
170166
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
171167
fn test_should_panic_good_message() {
172168
fn f() -> Result<(), String> {
@@ -195,9 +191,7 @@ fn test_should_panic_good_message() {
195191
assert_eq!(result, TrOk);
196192
}
197193

198-
// FIXME: Re-enable emscripten once it can catch panics again (introduced by #65251)
199194
#[test]
200-
#[cfg(not(target_os = "emscripten"))]
201195
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
202196
fn test_should_panic_bad_message() {
203197
use crate::tests::TrFailedMsg;
@@ -231,9 +225,7 @@ fn test_should_panic_bad_message() {
231225
assert_eq!(result, TrFailedMsg(failed_msg.to_string()));
232226
}
233227

234-
// FIXME: Re-enable emscripten once it can catch panics again (introduced by #65251)
235228
#[test]
236-
#[cfg(not(target_os = "emscripten"))]
237229
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
238230
fn test_should_panic_non_string_message_type() {
239231
use std::any::TypeId;
@@ -272,9 +264,7 @@ fn test_should_panic_non_string_message_type() {
272264
assert_eq!(result, TrFailedMsg(failed_msg));
273265
}
274266

275-
// FIXME: Re-enable emscripten once it can catch panics again (introduced by #65251)
276267
#[test]
277-
#[cfg(not(target_os = "emscripten"))]
278268
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
279269
fn test_should_panic_but_succeeds() {
280270
let should_panic_variants = [ShouldPanic::Yes, ShouldPanic::YesWithMessage("error message")];

0 commit comments

Comments
 (0)