diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-02-06 11:38:59 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-03-07 19:11:11 +0000 |
| commit | fb04372dc56129d69e39af80cac6e81694bd285f (patch) | |
| tree | d4fd781bb6863312e736358391f71f0c866247d4 | |
| parent | 03eb45452305f2d52348279d0caa5fc1f12c438d (diff) | |
Move all alloc integration tests to a new alloctests crate
| -rw-r--r-- | library/Cargo.lock | 8 | ||||
| -rw-r--r-- | library/Cargo.toml | 1 | ||||
| -rw-r--r-- | library/alloc/Cargo.toml | 18 | ||||
| -rw-r--r-- | library/alloc/src/raw_vec/mod.rs (renamed from library/alloc/src/raw_vec.rs) | 0 | ||||
| -rw-r--r-- | library/alloc/src/rc/mod.rs (renamed from library/alloc/src/rc.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/Cargo.toml | 46 | ||||
| -rw-r--r-- | library/alloctests/benches/binary_heap.rs (renamed from library/alloc/benches/binary_heap.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/benches/btree/map.rs (renamed from library/alloc/benches/btree/map.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/benches/btree/mod.rs (renamed from library/alloc/benches/btree/mod.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/benches/btree/set.rs (renamed from library/alloc/benches/btree/set.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/benches/lib.rs (renamed from library/alloc/benches/lib.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/benches/linked_list.rs (renamed from library/alloc/benches/linked_list.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/benches/slice.rs (renamed from library/alloc/benches/slice.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/benches/str.rs (renamed from library/alloc/benches/str.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/benches/string.rs (renamed from library/alloc/benches/string.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/benches/vec.rs (renamed from library/alloc/benches/vec.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/benches/vec_deque.rs (renamed from library/alloc/benches/vec_deque.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/benches/vec_deque_append.rs (renamed from library/alloc/benches/vec_deque_append.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/lib.rs | 1 | ||||
| -rw-r--r-- | library/alloctests/tests/alloc_test.rs (renamed from library/alloc/tests/alloc.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/arc.rs (renamed from library/alloc/tests/arc.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/autotraits.rs (renamed from library/alloc/tests/autotraits.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/borrow.rs (renamed from library/alloc/tests/borrow.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/boxed.rs (renamed from library/alloc/tests/boxed.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/btree_set_hash.rs (renamed from library/alloc/tests/btree_set_hash.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/c_str.rs (renamed from library/alloc/tests/c_str.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/c_str2.rs (renamed from library/alloc/tests/c_str2.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/collections/binary_heap.rs (renamed from library/alloc/tests/collections/binary_heap.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/collections/mod.rs (renamed from library/alloc/tests/collections/mod.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/const_fns.rs (renamed from library/alloc/tests/const_fns.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/cow_str.rs (renamed from library/alloc/tests/cow_str.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/fmt.rs (renamed from library/alloc/tests/fmt.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/heap.rs (renamed from library/alloc/tests/heap.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/lib.rs (renamed from library/alloc/tests/lib.rs) | 3 | ||||
| -rw-r--r-- | library/alloctests/tests/linked_list.rs (renamed from library/alloc/tests/linked_list.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/misc_tests.rs (renamed from library/alloc/tests/misc_tests.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/rc.rs (renamed from library/alloc/tests/rc.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/slice.rs (renamed from library/alloc/tests/slice.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/sort/ffi_types.rs (renamed from library/alloc/tests/sort/ffi_types.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/sort/known_good_stable_sort.rs (renamed from library/alloc/tests/sort/known_good_stable_sort.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/sort/mod.rs (renamed from library/alloc/tests/sort/mod.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/sort/patterns.rs (renamed from library/alloc/tests/sort/patterns.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/sort/tests.rs (renamed from library/alloc/tests/sort/tests.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/sort/zipf.rs (renamed from library/alloc/tests/sort/zipf.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/str.rs (renamed from library/alloc/tests/str.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/string.rs (renamed from library/alloc/tests/string.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/sync.rs (renamed from library/alloc/tests/sync.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/task.rs (renamed from library/alloc/tests/task.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/testing/crash_test.rs (renamed from library/alloc/tests/testing/crash_test.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/testing/mod.rs (renamed from library/alloc/tests/testing/mod.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/thin_box.rs (renamed from library/alloc/tests/thin_box.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/vec.rs (renamed from library/alloc/tests/vec.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/vec_deque.rs (renamed from library/alloc/tests/vec_deque.rs) | 0 | ||||
| -rw-r--r-- | library/alloctests/tests/vec_deque_alloc_error.rs (renamed from library/alloc/tests/vec_deque_alloc_error.rs) | 0 | ||||
| -rw-r--r-- | src/bootstrap/mk/Makefile.in | 2 | ||||
| -rw-r--r-- | src/bootstrap/src/core/build_steps/check.rs | 5 | ||||
| -rw-r--r-- | src/bootstrap/src/core/build_steps/test.rs | 12 | ||||
| -rw-r--r-- | src/tools/tidy/src/style.rs | 2 |
58 files changed, 73 insertions, 25 deletions
diff --git a/library/Cargo.lock b/library/Cargo.lock index 31656414121..bdf50a5b383 100644 --- a/library/Cargo.lock +++ b/library/Cargo.lock @@ -41,6 +41,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] +name = "alloctests" +version = "0.0.0" +dependencies = [ + "rand", + "rand_xorshift", +] + +[[package]] name = "cc" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" diff --git a/library/Cargo.toml b/library/Cargo.toml index 1205f7c9ed6..4d5955593ff 100644 --- a/library/Cargo.toml +++ b/library/Cargo.toml @@ -4,6 +4,7 @@ members = [ "std", "sysroot", "coretests", + "alloctests", ] exclude = [ diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml index 4cb83501256..d9e1c9b38a8 100644 --- a/library/alloc/Cargo.toml +++ b/library/alloc/Cargo.toml @@ -18,24 +18,6 @@ compiler_builtins = { version = "=0.1.151", features = ['rustc-dep-of-std'] } rand = { version = "0.9.0", default-features = false, features = ["alloc"] } rand_xorshift = "0.4.0" -[[test]] -name = "alloctests" -path = "tests/lib.rs" - -[[test]] -name = "vec_deque_alloc_error" -path = "tests/vec_deque_alloc_error.rs" - -[[bench]] -name = "allocbenches" -path = "benches/lib.rs" -test = true - -[[bench]] -name = "vec_deque_append_bench" -path = "benches/vec_deque_append.rs" -harness = false - [features] compiler-builtins-mem = ['compiler_builtins/mem'] compiler-builtins-c = ["compiler_builtins/c"] diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec/mod.rs index 70f32fbaab4..70f32fbaab4 100644 --- a/library/alloc/src/raw_vec.rs +++ b/library/alloc/src/raw_vec/mod.rs diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc/mod.rs index 09206c2f8b2..09206c2f8b2 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc/mod.rs diff --git a/library/alloctests/Cargo.toml b/library/alloctests/Cargo.toml new file mode 100644 index 00000000000..f1a783b1e22 --- /dev/null +++ b/library/alloctests/Cargo.toml @@ -0,0 +1,46 @@ +[package] +name = "alloctests" +version = "0.0.0" +license = "MIT OR Apache-2.0" +repository = "https://github.com/rust-lang/rust.git" +description = "Tests for the Rust Allocation Library" +autotests = false +autobenches = false +edition = "2021" + +[lib] +path = "lib.rs" +test = false +bench = false + +[dev-dependencies] +rand = { version = "0.9.0", default-features = false, features = ["alloc"] } +rand_xorshift = "0.4.0" + +[[test]] +name = "alloctests" +path = "tests/lib.rs" + +[[test]] +name = "vec_deque_alloc_error" +path = "tests/vec_deque_alloc_error.rs" + +[[bench]] +name = "allocbenches" +path = "benches/lib.rs" +test = true + +[[bench]] +name = "vec_deque_append_bench" +path = "benches/vec_deque_append.rs" +harness = false + +[lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = [ + 'cfg(bootstrap)', + 'cfg(no_global_oom_handling)', + 'cfg(no_rc)', + 'cfg(no_sync)', + 'cfg(randomized_layouts)', +] diff --git a/library/alloc/benches/binary_heap.rs b/library/alloctests/benches/binary_heap.rs index 1b8f7f1c242..1b8f7f1c242 100644 --- a/library/alloc/benches/binary_heap.rs +++ b/library/alloctests/benches/binary_heap.rs diff --git a/library/alloc/benches/btree/map.rs b/library/alloctests/benches/btree/map.rs index 20f02dc3a96..20f02dc3a96 100644 --- a/library/alloc/benches/btree/map.rs +++ b/library/alloctests/benches/btree/map.rs diff --git a/library/alloc/benches/btree/mod.rs b/library/alloctests/benches/btree/mod.rs index 095ca5dd2e2..095ca5dd2e2 100644 --- a/library/alloc/benches/btree/mod.rs +++ b/library/alloctests/benches/btree/mod.rs diff --git a/library/alloc/benches/btree/set.rs b/library/alloctests/benches/btree/set.rs index 5aa395b4d52..5aa395b4d52 100644 --- a/library/alloc/benches/btree/set.rs +++ b/library/alloctests/benches/btree/set.rs diff --git a/library/alloc/benches/lib.rs b/library/alloctests/benches/lib.rs index 2633154318c..2633154318c 100644 --- a/library/alloc/benches/lib.rs +++ b/library/alloctests/benches/lib.rs diff --git a/library/alloc/benches/linked_list.rs b/library/alloctests/benches/linked_list.rs index b9322b6d4c3..b9322b6d4c3 100644 --- a/library/alloc/benches/linked_list.rs +++ b/library/alloctests/benches/linked_list.rs diff --git a/library/alloc/benches/slice.rs b/library/alloctests/benches/slice.rs index 27b0e6fac0a..27b0e6fac0a 100644 --- a/library/alloc/benches/slice.rs +++ b/library/alloctests/benches/slice.rs diff --git a/library/alloc/benches/str.rs b/library/alloctests/benches/str.rs index 98c7c5413ca..98c7c5413ca 100644 --- a/library/alloc/benches/str.rs +++ b/library/alloctests/benches/str.rs diff --git a/library/alloc/benches/string.rs b/library/alloctests/benches/string.rs index 3d79ab78c69..3d79ab78c69 100644 --- a/library/alloc/benches/string.rs +++ b/library/alloctests/benches/string.rs diff --git a/library/alloc/benches/vec.rs b/library/alloctests/benches/vec.rs index 1dab71fa1f4..1dab71fa1f4 100644 --- a/library/alloc/benches/vec.rs +++ b/library/alloctests/benches/vec.rs diff --git a/library/alloc/benches/vec_deque.rs b/library/alloctests/benches/vec_deque.rs index a56f8496963..a56f8496963 100644 --- a/library/alloc/benches/vec_deque.rs +++ b/library/alloctests/benches/vec_deque.rs diff --git a/library/alloc/benches/vec_deque_append.rs b/library/alloctests/benches/vec_deque_append.rs index 7c805da9737..7c805da9737 100644 --- a/library/alloc/benches/vec_deque_append.rs +++ b/library/alloctests/benches/vec_deque_append.rs diff --git a/library/alloctests/lib.rs b/library/alloctests/lib.rs new file mode 100644 index 00000000000..b49208cd4eb --- /dev/null +++ b/library/alloctests/lib.rs @@ -0,0 +1 @@ +// Intentionally left empty. diff --git a/library/alloc/tests/alloc.rs b/library/alloctests/tests/alloc_test.rs index 1e722d66795..1e722d66795 100644 --- a/library/alloc/tests/alloc.rs +++ b/library/alloctests/tests/alloc_test.rs diff --git a/library/alloc/tests/arc.rs b/library/alloctests/tests/arc.rs index 0baa50f439b..0baa50f439b 100644 --- a/library/alloc/tests/arc.rs +++ b/library/alloctests/tests/arc.rs diff --git a/library/alloc/tests/autotraits.rs b/library/alloctests/tests/autotraits.rs index 6b82deeac8a..6b82deeac8a 100644 --- a/library/alloc/tests/autotraits.rs +++ b/library/alloctests/tests/autotraits.rs diff --git a/library/alloc/tests/borrow.rs b/library/alloctests/tests/borrow.rs index af7efb7d782..af7efb7d782 100644 --- a/library/alloc/tests/borrow.rs +++ b/library/alloctests/tests/borrow.rs diff --git a/library/alloc/tests/boxed.rs b/library/alloctests/tests/boxed.rs index 94389cf2de9..94389cf2de9 100644 --- a/library/alloc/tests/boxed.rs +++ b/library/alloctests/tests/boxed.rs diff --git a/library/alloc/tests/btree_set_hash.rs b/library/alloctests/tests/btree_set_hash.rs index 71a3a143209..71a3a143209 100644 --- a/library/alloc/tests/btree_set_hash.rs +++ b/library/alloctests/tests/btree_set_hash.rs diff --git a/library/alloc/tests/c_str.rs b/library/alloctests/tests/c_str.rs index 4a581793956..4a581793956 100644 --- a/library/alloc/tests/c_str.rs +++ b/library/alloctests/tests/c_str.rs diff --git a/library/alloc/tests/c_str2.rs b/library/alloctests/tests/c_str2.rs index 0f4c27fa123..0f4c27fa123 100644 --- a/library/alloc/tests/c_str2.rs +++ b/library/alloctests/tests/c_str2.rs diff --git a/library/alloc/tests/collections/binary_heap.rs b/library/alloctests/tests/collections/binary_heap.rs index 95f4c3e614f..95f4c3e614f 100644 --- a/library/alloc/tests/collections/binary_heap.rs +++ b/library/alloctests/tests/collections/binary_heap.rs diff --git a/library/alloc/tests/collections/mod.rs b/library/alloctests/tests/collections/mod.rs index e73f3aaef8c..e73f3aaef8c 100644 --- a/library/alloc/tests/collections/mod.rs +++ b/library/alloctests/tests/collections/mod.rs diff --git a/library/alloc/tests/const_fns.rs b/library/alloctests/tests/const_fns.rs index 4e7d7fc833e..4e7d7fc833e 100644 --- a/library/alloc/tests/const_fns.rs +++ b/library/alloctests/tests/const_fns.rs diff --git a/library/alloc/tests/cow_str.rs b/library/alloctests/tests/cow_str.rs index 62a5c245a54..62a5c245a54 100644 --- a/library/alloc/tests/cow_str.rs +++ b/library/alloctests/tests/cow_str.rs diff --git a/library/alloc/tests/fmt.rs b/library/alloctests/tests/fmt.rs index c13074c53b7..c13074c53b7 100644 --- a/library/alloc/tests/fmt.rs +++ b/library/alloctests/tests/fmt.rs diff --git a/library/alloc/tests/heap.rs b/library/alloctests/tests/heap.rs index 246b341eeb3..246b341eeb3 100644 --- a/library/alloc/tests/heap.rs +++ b/library/alloctests/tests/heap.rs diff --git a/library/alloc/tests/lib.rs b/library/alloctests/tests/lib.rs index 785070fb2bb..46c11ea150b 100644 --- a/library/alloc/tests/lib.rs +++ b/library/alloctests/tests/lib.rs @@ -43,11 +43,12 @@ #![deny(fuzzy_provenance_casts)] #![deny(unsafe_op_in_unsafe_fn)] +extern crate alloc; extern crate test; use std::hash::{DefaultHasher, Hash, Hasher}; -mod alloc; +mod alloc_test; mod arc; mod autotraits; mod borrow; diff --git a/library/alloc/tests/linked_list.rs b/library/alloctests/tests/linked_list.rs index 65b09cb00c4..65b09cb00c4 100644 --- a/library/alloc/tests/linked_list.rs +++ b/library/alloctests/tests/linked_list.rs diff --git a/library/alloc/tests/misc_tests.rs b/library/alloctests/tests/misc_tests.rs index b95d11cb07e..b95d11cb07e 100644 --- a/library/alloc/tests/misc_tests.rs +++ b/library/alloctests/tests/misc_tests.rs diff --git a/library/alloc/tests/rc.rs b/library/alloctests/tests/rc.rs index 9d82a7621a2..9d82a7621a2 100644 --- a/library/alloc/tests/rc.rs +++ b/library/alloctests/tests/rc.rs diff --git a/library/alloc/tests/slice.rs b/library/alloctests/tests/slice.rs index 2516563187f..2516563187f 100644 --- a/library/alloc/tests/slice.rs +++ b/library/alloctests/tests/slice.rs diff --git a/library/alloc/tests/sort/ffi_types.rs b/library/alloctests/tests/sort/ffi_types.rs index 11515ea4769..11515ea4769 100644 --- a/library/alloc/tests/sort/ffi_types.rs +++ b/library/alloctests/tests/sort/ffi_types.rs diff --git a/library/alloc/tests/sort/known_good_stable_sort.rs b/library/alloctests/tests/sort/known_good_stable_sort.rs index 2df89146253..2df89146253 100644 --- a/library/alloc/tests/sort/known_good_stable_sort.rs +++ b/library/alloctests/tests/sort/known_good_stable_sort.rs diff --git a/library/alloc/tests/sort/mod.rs b/library/alloctests/tests/sort/mod.rs index 0e2494ca9d3..0e2494ca9d3 100644 --- a/library/alloc/tests/sort/mod.rs +++ b/library/alloctests/tests/sort/mod.rs diff --git a/library/alloc/tests/sort/patterns.rs b/library/alloctests/tests/sort/patterns.rs index 0f1ec664d3d..0f1ec664d3d 100644 --- a/library/alloc/tests/sort/patterns.rs +++ b/library/alloctests/tests/sort/patterns.rs diff --git a/library/alloc/tests/sort/tests.rs b/library/alloctests/tests/sort/tests.rs index d321f8df518..d321f8df518 100644 --- a/library/alloc/tests/sort/tests.rs +++ b/library/alloctests/tests/sort/tests.rs diff --git a/library/alloc/tests/sort/zipf.rs b/library/alloctests/tests/sort/zipf.rs index 3dad2db521f..3dad2db521f 100644 --- a/library/alloc/tests/sort/zipf.rs +++ b/library/alloctests/tests/sort/zipf.rs diff --git a/library/alloc/tests/str.rs b/library/alloctests/tests/str.rs index 906fa2d425e..906fa2d425e 100644 --- a/library/alloc/tests/str.rs +++ b/library/alloctests/tests/str.rs diff --git a/library/alloc/tests/string.rs b/library/alloctests/tests/string.rs index d996c55f946..d996c55f946 100644 --- a/library/alloc/tests/string.rs +++ b/library/alloctests/tests/string.rs diff --git a/library/alloc/tests/sync.rs b/library/alloctests/tests/sync.rs index 6d3ab1b1d11..6d3ab1b1d11 100644 --- a/library/alloc/tests/sync.rs +++ b/library/alloctests/tests/sync.rs diff --git a/library/alloc/tests/task.rs b/library/alloctests/tests/task.rs index 390dec14484..390dec14484 100644 --- a/library/alloc/tests/task.rs +++ b/library/alloctests/tests/task.rs diff --git a/library/alloc/tests/testing/crash_test.rs b/library/alloctests/tests/testing/crash_test.rs index 502fe6c10c6..502fe6c10c6 100644 --- a/library/alloc/tests/testing/crash_test.rs +++ b/library/alloctests/tests/testing/crash_test.rs diff --git a/library/alloc/tests/testing/mod.rs b/library/alloctests/tests/testing/mod.rs index 0a3dd191dc8..0a3dd191dc8 100644 --- a/library/alloc/tests/testing/mod.rs +++ b/library/alloctests/tests/testing/mod.rs diff --git a/library/alloc/tests/thin_box.rs b/library/alloctests/tests/thin_box.rs index 4c46b614127..4c46b614127 100644 --- a/library/alloc/tests/thin_box.rs +++ b/library/alloctests/tests/thin_box.rs diff --git a/library/alloc/tests/vec.rs b/library/alloctests/tests/vec.rs index f430d979fa8..f430d979fa8 100644 --- a/library/alloc/tests/vec.rs +++ b/library/alloctests/tests/vec.rs diff --git a/library/alloc/tests/vec_deque.rs b/library/alloctests/tests/vec_deque.rs index 1b03c29e5bd..1b03c29e5bd 100644 --- a/library/alloc/tests/vec_deque.rs +++ b/library/alloctests/tests/vec_deque.rs diff --git a/library/alloc/tests/vec_deque_alloc_error.rs b/library/alloctests/tests/vec_deque_alloc_error.rs index 21a9118a05b..21a9118a05b 100644 --- a/library/alloc/tests/vec_deque_alloc_error.rs +++ b/library/alloctests/tests/vec_deque_alloc_error.rs diff --git a/src/bootstrap/mk/Makefile.in b/src/bootstrap/mk/Makefile.in index 88aa70d4f2f..6cb0b19d763 100644 --- a/src/bootstrap/mk/Makefile.in +++ b/src/bootstrap/mk/Makefile.in @@ -56,6 +56,7 @@ check-aux: # Run standard library tests in Miri. $(Q)$(BOOTSTRAP) miri --stage 2 \ library/coretests \ + library/alloctests \ library/alloc \ $(BOOTSTRAP_ARGS) \ --no-doc @@ -63,6 +64,7 @@ check-aux: $(Q)MIRIFLAGS="-Zmiri-disable-isolation" \ $(BOOTSTRAP) miri --stage 2 \ library/coretests \ + library/alloctests \ library/alloc \ $(BOOTSTRAP_ARGS) \ --doc diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index b8bbe1eb5f8..18aa3119842 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -45,7 +45,10 @@ impl Step for Std { const DEFAULT: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.crate_or_deps("sysroot").crate_or_deps("coretests").path("library") + run.crate_or_deps("sysroot") + .crate_or_deps("coretests") + .crate_or_deps("alloctests") + .path("library") } fn make_run(run: RunConfig<'_>) { diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 4b7c8d5770e..e80f8f9a4b7 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -2609,7 +2609,7 @@ impl Step for Crate { const DEFAULT: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.crate_or_deps("sysroot").crate_or_deps("coretests") + run.crate_or_deps("sysroot").crate_or_deps("coretests").crate_or_deps("alloctests") } fn make_run(run: RunConfig<'_>) { @@ -2724,12 +2724,16 @@ impl Step for Crate { }; let mut crates = self.crates.clone(); - // The core crate can't directly be tested. We could silently - // ignore it, but adding it's own test crate is less confusing - // for users. We still keep core itself for doctests. + // The core and alloc crates can't directly be tested. We + // could silently ignore them, but adding their own test + // crates is less confusing for users. We still keep core and + // alloc themself for doctests if crates.iter().any(|crate_| crate_ == "core") { crates.push("coretests".to_owned()); } + if crates.iter().any(|crate_| crate_ == "alloc") { + crates.push("alloctests".to_owned()); + } run_cargo_test(cargo, &[], &crates, &*crate_description(&self.crates), target, builder); } diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index 205d6720718..2237eac200d 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -475,7 +475,7 @@ pub fn check(path: &Path, bad: &mut bool) { && !trimmed.starts_with("//") && !file.ancestors().any(|a| { (a.ends_with("tests") && a.join("COMPILER_TESTS.md").exists()) - || a.ends_with("library/alloc/tests") + || a.ends_with("library/alloctests") }) && filename != "tests.rs" { |
