Skip to content
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

Fix paths to coretests and alloctests #139123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thaliaarchi
Copy link
Contributor

Following #135937 and #136642, tests for core and alloc are in coretests and alloctests. Update paths referring to the old locations.

Some context for changes which don't match that pattern:

  • library/std/src/thread/local/dynamic_tests.rs and library/std/src/sync/mpsc/sync_tests.rs were moved under library/std/tests/ in 332fb7e (Move std::thread_local unit tests to integration tests, 2025-01-17) and b8ae372 (Move std::sync unit tests to integration tests, 2025-01-17), respectively, so are no longer special cases.
  • There never was a library/core/tests/fmt.rs file. That comment previously referred to src/test/ui/ifmt.rs, which was folded into library/alloc/tests/fmt.rs in 949c966 (move format! interface tests, 2020-09-08).

Now, the only matches for (alloc|core)/tests are in compiler/rustc_codegen_{cranelift,gcc}/patches. I don't know why CI hasn't broken because those patches can't apply. Or maybe they somehow still can apply?

I don't know how to test the changes to tidy here.

r? @bjorn3

@rustbot rustbot added A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 30, 2025
@rustbot
Copy link
Collaborator

rustbot commented Mar 30, 2025

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@rust-log-analyzer

This comment has been minimized.

@thaliaarchi
Copy link
Contributor Author

Looks like my changes to tidy work! Mostly.

Since those particular tests which CI detected exercise the internals of collections, they currently have to be part of alloc. Perhaps they should be added an allowlist?

Following `rust-lang#135937` and `rust-lang#136642`, tests for core and alloc are in
coretests and alloctests. Update paths referring to the old locations.

Some context for changes which don't match that pattern:
* library/std/src/thread/local/dynamic_tests.rs and
  library/std/src/sync/mpsc/sync_tests.rs were moved under
  library/std/tests/ in 332fb7e (Move std::thread_local unit tests
  to integration tests, 2025-01-17) and b8ae372 (Move std::sync unit
  tests to integration tests, 2025-01-17), respectively, so are no
  longer special cases.
* There never was a library/core/tests/fmt.rs file. That comment
  previously referred to src/test/ui/ifmt.rs, which was folded into
  library/alloc/tests/fmt.rs in 949c966 (move format! interface
  tests, 2020-09-08).
@thaliaarchi thaliaarchi force-pushed the core-alloc-test-paths branch from 2db2a3f to d5760fe Compare March 30, 2025 00:44
@bjorn3
Copy link
Member

bjorn3 commented Mar 31, 2025

Now, the only matches for (alloc|core)/tests are in compiler/rustc_codegen_{cranelift,gcc}/patches. I don't know why CI hasn't broken because those patches can't apply. Or maybe they somehow still can apply?

For cg_clif at least this is because the core tests don't run in CI here. In any case yesterday's sync PR fixed all references in cg_clif.

@@ -677,7 +677,7 @@ fn test_projects(env: &Env, args: &TestArg) -> Result<(), String> {
fn test_libcore(env: &Env, args: &TestArg) -> Result<(), String> {
// FIXME: create a function "display_if_not_quiet" or something along the line.
println!("[TEST] libcore");
let path = get_sysroot_dir().join("sysroot_src/library/core/tests");
let path = get_sysroot_dir().join("sysroot_src/library/coretests/tests");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let path = get_sysroot_dir().join("sysroot_src/library/coretests/tests");
let path = get_sysroot_dir().join("sysroot_src/library/coretests");

and remove compiler/rustc_codegen_gcc/patches/0022-core-Disable-not-compiling-tests.patch.

Comment on lines 4 to +6
//! `#![no_core]` libraries cannot be tested directly due to duplicating lang
//! items. All tests and benchmarks must be written externally in `core/{tests,benches}`.
//! items. All tests and benchmarks must be written externally in
//! `{coretests,alloctests}/{tests,benches}`.
Copy link
Member

Choose a reason for hiding this comment

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

Instead of referring to #![no_core] libraries maybe instead refer to core and alloc? alloc is not #![no_core].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants