Skip to content

Remove some unnecessary things #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions alloc_miri_test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
[package]
name = "alloc_miri_test"
name = "alloc"
version = "0.0.0"
autotests = false
autobenches = false
edition = "2021"

[lib]
name = "alloc_miri_test"
path = "../library/alloc/src/lib.rs"

[features]
# Empty this crate to avoid two copies of liballoc.
# See https://github.com/rust-lang/miri-test-libstd/issues/4.
default = ["miri-test-libstd"]
miri-test-libstd = []

[dependencies]
# This lets the crate access the `core` and `alloc` crates.
core = { path = "../fake/core" }
alloc = { path = "../fake/alloc" }

[dev-dependencies]
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
rand_xorshift = "0.3.0"

[[test]]
name = "collectionstests"
name = "alloc-lib"
path = "../library/alloc/src/lib.rs"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that is clever -- so you are basically turning the unit tests into integration tests, but since they are mostly importing things from alloc (which will then be the sysroot crate) that still works? Or why exactly does this work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't. ^^' I merged this with the fake alloc, and now it should work.


[[test]]
name = "alloc-tests"
path = "../library/alloc/tests/lib.rs"
4 changes: 4 additions & 0 deletions alloc_miri_test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#![feature(no_core, rustc_private)]
#![no_core]
extern crate alloc as realalloc;
pub use realalloc::*;
6 changes: 3 additions & 3 deletions ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ core)
for TARGET in x86_64-unknown-linux-gnu mips-unknown-linux-gnu; do
echo "::group::Testing core ($TARGET, no validation, no Stacked Borrows, symbolic alignment)"
MIRIFLAGS="$DEFAULTFLAGS -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -Zmiri-symbolic-alignment-check" \
./run-test.sh core --target $TARGET --lib --tests \
./run-test.sh core --target $TARGET --tests \
-- --skip align \
2>&1 | ts -i '%.s '
echo "::endgroup::"
echo "::group::Testing core ($TARGET)"
MIRIFLAGS="$DEFAULTFLAGS" \
./run-test.sh core --target $TARGET --lib --tests \
./run-test.sh core --target $TARGET --tests \
2>&1 | ts -i '%.s '
echo "::endgroup::"
echo "::group::Testing core docs ($TARGET, ignore leaks)" && echo
Expand All @@ -39,7 +39,7 @@ alloc)
for TARGET in x86_64-unknown-linux-gnu mips-unknown-linux-gnu; do
echo "::group::Testing alloc ($TARGET, symbolic alignment)"
MIRIFLAGS="$DEFAULTFLAGS -Zmiri-symbolic-alignment-check" \
./run-test.sh alloc --target $TARGET --lib --tests \
./run-test.sh alloc --target $TARGET --tests \
2>&1 | ts -i '%.s '
echo "::endgroup::"
echo "::group::Testing alloc docs ($TARGET, ignore leaks)"
Expand Down
16 changes: 0 additions & 16 deletions core_miri_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,10 @@ autotests = false
autobenches = false
edition = "2021"

[lib]
name = "core_miri_test"
path = "../library/core/src/lib.rs"
test = false
bench = false

[features]
# Empty this crate to avoid two copies of libcore.
# See https://github.com/rust-lang/miri-test-libstd/issues/4.
default = ["miri-test-libstd"]
miri-test-libstd = []

[[test]]
name = "coretests"
path = "../library/core/tests/lib.rs"

[dependencies]
# This lets the crate access the `core` crate.
core = { path = "../fake/core" }

[dev-dependencies]
rand = { version = "0.8.5", default-features = false }
rand_xorshift = { version = "0.3.0", default-features = false }
7 changes: 0 additions & 7 deletions fake/alloc/Cargo.toml

This file was deleted.

9 changes: 0 additions & 9 deletions fake/alloc/lib.rs

This file was deleted.

7 changes: 0 additions & 7 deletions fake/core/Cargo.toml

This file was deleted.

5 changes: 0 additions & 5 deletions fake/core/lib.rs

This file was deleted.

3 changes: 1 addition & 2 deletions std_miri_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ path = "../library/std/src/lib.rs"
# just a bunch of fake crates that reeexport sysroot crates, so that std's imports work out
# (this works because we only build std as a test; the regular crate build is
# completely empty thanks to the `miri-test-libstd` feature below)
core = { path = "../fake/core" }
alloc = { path = "../fake/alloc" }
alloc = { path = "../alloc_miri_test" }
cfg-if = { path = "../fake/cfg-if" }
libc = { path = "../fake/libc" }
hashbrown = { path = "../fake/hashbrown" }
Expand Down