Skip to content

Commit 31329f9

Browse files
committed
Enable rand based libcore tests
Part of #806
1 parent 6b0c411 commit 31329f9

File tree

2 files changed

+20
-33
lines changed

2 files changed

+20
-33
lines changed

patches/0022-sysroot-Disable-not-compiling-tests.patch

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ new file mode 100644
1818
index 0000000..46fd999
1919
--- /dev/null
2020
+++ b/library/core/tests/Cargo.toml
21-
@@ -0,0 +1,8 @@
21+
@@ -0,0 +1,11 @@
2222
+[package]
2323
+name = "core"
2424
+version = "0.0.0"
@@ -27,18 +27,9 @@ index 0000000..46fd999
2727
+[lib]
2828
+name = "coretests"
2929
+path = "lib.rs"
30-
diff --git a/library/core/tests/num/flt2dec/mod.rs b/library/core/tests/num/flt2dec/mod.rs
31-
index a35897e..f0bf645 100644
32-
--- a/library/core/tests/num/flt2dec/mod.rs
33-
+++ b/library/core/tests/num/flt2dec/mod.rs
34-
@@ -13,7 +13,6 @@ mod strategy {
35-
mod dragon;
36-
mod grisu;
37-
}
38-
-mod random;
39-
40-
pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
41-
match decode(v).1 {
30+
+
31+
+[dependencies]
32+
+rand = "0.7"
4233
diff --git a/library/core/tests/ptr.rs b/library/core/tests/ptr.rs
4334
index 1a6be3a..42dbd59 100644
4435
--- a/library/core/tests/ptr.rs
@@ -59,25 +50,5 @@ index 1a6be3a..42dbd59 100644
5950

6051
#[test]
6152
fn write_unaligned_drop() {
62-
diff --git a/library/core/tests/slice.rs b/library/core/tests/slice.rs
63-
index 6609bc3..241b497 100644
64-
--- a/library/core/tests/slice.rs
65-
+++ b/library/core/tests/slice.rs
66-
@@ -1209,6 +1209,7 @@ fn brute_force_rotate_test_1() {
67-
}
68-
}
69-
70-
+/*
71-
#[test]
72-
#[cfg(not(target_arch = "wasm32"))]
73-
fn sort_unstable() {
74-
@@ -1394,6 +1395,7 @@ fn partition_at_index() {
75-
v.select_nth_unstable(0);
76-
assert!(v == [0xDEADBEEF]);
77-
}
78-
+*/
79-
80-
#[test]
81-
#[should_panic(expected = "index 0 greater than length of slice")]
8253
--
8354
2.21.0 (Apple Git-122)

patches/0028-sysroot-Disable-long-running-tests.patch

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ diff --git a/library/core/tests/slice.rs b/library/core/tests/slice.rs
1111
index 8402833..84592e0 100644
1212
--- a/library/core/tests/slice.rs
1313
+++ b/library/core/tests/slice.rs
14+
@@ -1809,6 +1809,7 @@ fn sort_unstable() {
15+
assert!(v == [0xDEADBEEF]);
16+
}
17+
18+
+/*
19+
#[test]
20+
#[cfg(not(target_arch = "wasm32"))]
21+
#[cfg_attr(miri, ignore)] // Miri is too slow
22+
@@ -1914,6 +1915,7 @@ fn select_nth_unstable() {
23+
v.select_nth_unstable(0);
24+
assert!(v == [0xDEADBEEF]);
25+
}
26+
+*/
27+
28+
#[test]
29+
#[should_panic(expected = "index 0 greater than length of slice")]
1430
@@ -2462,6 +2462,7 @@ take_tests! {
1531
#[cfg(not(miri))] // unused in Miri
1632
const EMPTY_MAX: &'static [()] = &[(); usize::MAX];

0 commit comments

Comments
 (0)