-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Put the alloc unit tests in a separate alloctests package #136642
base: master
Are you sure you want to change the base?
Conversation
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
d40470e
to
34a86f7
Compare
This comment has been minimized.
This comment has been minimized.
34a86f7
to
68120bf
Compare
This comment has been minimized.
This comment has been minimized.
68120bf
to
8f1c7c3
Compare
☔ The latest upstream changes (presumably #136697) made this pull request unmergeable. Please resolve the merge conflicts. |
8f1c7c3
to
1726670
Compare
@bors r+ |
…=cuviper Put the alloc unit tests in a separate alloctests package Same rationale as rust-lang#135937. This PR has some extra complexity though as a decent amount of tests are testing internal implementation details rather than the public api. As such I opted to include the modules containing the types under test using `#[path]` into the alloctests package. This means that those modules still need `#[cfg(test)]`, but the rest of liballoc no longer need it.
…kingjubilee Rollup of 13 pull requests Successful merges: - rust-lang#135439 (Make `-O` mean `OptLevel::Aggressive`) - rust-lang#136460 (Simplify `rustc_span` `analyze_source_file`) - rust-lang#136642 (Put the alloc unit tests in a separate alloctests package) - rust-lang#136904 (add `IntoBounds` trait) - rust-lang#136908 ([AIX] expect `EINVAL` for `pthread_mutex_destroy`) - rust-lang#136924 (Add profiling of bootstrap commands using Chrome events) - rust-lang#136951 (Use the right binder for rebinding `PolyTraitRef`) - rust-lang#136956 (add vendor directory to .gitignore) - rust-lang#136967 (Use `slice::fill` in `io::Repeat` implementation) - rust-lang#136976 (alloc boxed: docs: use MaybeUninit::write instead of as_mut_ptr) - rust-lang#136981 (ci: switch loongarch jobs to free runners) - rust-lang#136992 (Update backtrace) - rust-lang#136993 ([cg_llvm] Remove dead error message) r? `@ghost` `@rustbot` modify labels: rollup
Testing for #136998 (comment) |
@bors r+ |
…=cuviper Put the alloc unit tests in a separate alloctests package Same rationale as rust-lang#135937. This PR has some extra complexity though as a decent amount of tests are testing internal implementation details rather than the public api. As such I opted to include the modules containing the types under test using `#[path]` into the alloctests package. This means that those modules still need `#[cfg(test)]`, but the rest of liballoc no longer need it.
…mpiler-errors Rollup of 10 pull requests Successful merges: - rust-lang#136642 (Put the alloc unit tests in a separate alloctests package) - rust-lang#136910 (Implement feature `isolate_most_least_significant_one` for integer types) - rust-lang#137183 (Prune dead regionck code) - rust-lang#137333 (Use `edition = "2024"` in the compiler (redux)) - rust-lang#137356 (Ferris 🦀 Identifier naming conventions) - rust-lang#137362 (Add build step log for `run-make-support`) - rust-lang#137377 (Always allow reusing cratenum in CrateLoader::load) - rust-lang#137388 (Fix(lib/fs/tests): Disable rename POSIX semantics FS tests under Windows 7) - rust-lang#137410 (Use StableHasher + Hash64 for dep_tracking_hash) - rust-lang#137413 (jubilee cleared out the review queue) r? `@ghost` `@rustbot` modify labels: rollup
@bors r- |
Any way we can keep |
// The core and alloc crates can't directly be tested. We could | ||
// silently ignore them, but replacing them with their test crate | ||
// is less confusing for users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it still possible to run doc-tests now? If ./x test library/core
silently aliases ./x test library/coretests
, then it becomes impossible to run the doctests in libcore...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that should probably be handled using a separate doctest only cargo test
invocation. cargo test -p core -p alloc
will override the test = false
in their respective Cargo.toml. So cargo test -p core -p alloc --doc
would be necessary to only test doctests I think.
☔ The latest upstream changes (presumably #137571) made this pull request unmergeable. Please resolve the merge conflicts. |
This overrides the test=false flag in Cargo.toml and it shouldn't be necessary as --tests is already passed.
Opened #137679 to fix some of the issues this PR was facing without doing the actual move of liballoc tests. |
9c88f10
to
7d547bf
Compare
It is reasonable to expect that ./x.py test core is enough to run tests when you are working on core. In addition it seems like CI for wasm32 at least doesn't run coretests currently, which this commit fixes.
For the tests that make use of internal implementation details, we include the module to test using #[path] in alloctests now.
7d547bf
to
9dca456
Compare
Same rationale as #135937. This PR has some extra complexity though as a decent amount of tests are testing internal implementation details rather than the public api. As such I opted to include the modules containing the types under test using
#[path]
into the alloctests package. This means that those modules still need#[cfg(test)]
, but the rest of liballoc no longer need it.