Skip to content

Commit 1adce90

Browse files
committed
Run alloctests tests too
1 parent ebef14a commit 1adce90

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed

build_system/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
158158

159159
if runner.is_native {
160160
let mut test_cmd = SYSROOT_TESTS.test(&runner.target_compiler, &runner.dirs);
161-
test_cmd.args(["-p", "coretests", "--", "-q"]);
161+
test_cmd.args(["-p", "coretests", "-p", "alloctests", "--", "-q"]);
162162
spawn_and_wait(test_cmd);
163163
} else {
164164
eprintln!("Cross-Compiling: Not running tests");
165165
let mut build_cmd = SYSROOT_TESTS.build(&runner.target_compiler, &runner.dirs);
166-
build_cmd.args(["-p", "coretests", "--tests"]);
166+
build_cmd.args(["-p", "coretests", "-p", "alloctests", "--tests"]);
167167
spawn_and_wait(build_cmd);
168168
}
169169
}),

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

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,63 @@ index 8402833..84592e0 100644
4343

4444
#[test]
4545
fn test_slice_from_ptr_range() {
46+
diff --git a/alloctests/tests/sort/tests.rs b/alloctests/tests/sort/tests.rs
47+
index d321f8d..8b2040a 100644
48+
--- a/alloctests/tests/sort/tests.rs
49+
+++ b/alloctests/tests/sort/tests.rs
50+
@@ -1,3 +1,5 @@
51+
+#![cfg(any())]
52+
+
53+
use std::cell::Cell;
54+
use std::cmp::Ordering;
55+
use std::fmt::Debug;
56+
diff --git a/alloctests/tests/str.rs b/alloctests/tests/str.rs
57+
index 906fa2d..b82fa99 100644
58+
--- a/alloctests/tests/str.rs
59+
+++ b/alloctests/tests/str.rs
60+
@@ -2234,7 +2234,7 @@ fn const_str_ptr() {
61+
const C: *const u8 = B as *const u8;
62+
63+
// Miri does not deduplicate consts (https://github.com/rust-lang/miri/issues/131)
64+
- #[cfg(not(miri))]
65+
+ #[cfg(any())]
66+
{
67+
let foo = &A as *const u8;
68+
assert_eq!(foo, C);
69+
diff --git a/alloctests/tests/task.rs b/alloctests/tests/task.rs
70+
index 390dec1..87df6e6 100644
71+
--- a/alloctests/tests/task.rs
72+
+++ b/alloctests/tests/task.rs
73+
@@ -4,7 +4,7 @@ use alloc::task::{LocalWake, Wake};
74+
use core::task::{LocalWaker, Waker};
75+
76+
#[test]
77+
-#[cfg_attr(miri, ignore)] // `will_wake` doesn't guarantee that this test will work, and indeed on Miri it can fail
78+
+#[ignore] // `will_wake` doesn't guarantee that this test will work, and indeed on Miri it can fail
79+
fn test_waker_will_wake_clone() {
80+
struct NoopWaker;
81+
82+
@@ -20,7 +20,7 @@ fn test_waker_will_wake_clone() {
83+
}
84+
85+
#[test]
86+
-#[cfg_attr(miri, ignore)] // `will_wake` doesn't guarantee that this test will work, and indeed on Miri it can fail
87+
+#[ignore] // `will_wake` doesn't guarantee that this test will work, and indeed on Miri it can fail
88+
fn test_local_waker_will_wake_clone() {
89+
struct NoopWaker;
90+
91+
diff --git a/alloctests/tests/vec.rs b/alloctests/tests/vec.rs
92+
index f430d97..cfbd3cb 100644
93+
--- a/alloctests/tests/vec.rs
94+
+++ b/alloctests/tests/vec.rs
95+
@@ -762,6 +762,7 @@ fn test_drain_inclusive_range() {
96+
}
97+
98+
#[test]
99+
+#[ignore]
100+
fn test_drain_max_vec_size() {
101+
let mut v = Vec::<()>::with_capacity(usize::MAX);
102+
unsafe {
46103
--
47104
2.26.2.7.g19db9cfb68
48105

0 commit comments

Comments
 (0)