Skip to content

Move stdlib tests from src/test/ui-fulldeps to library/std/tests #99417

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
5 tasks done
ChrisDenton opened this issue Jul 18, 2022 · 20 comments
Closed
5 tasks done

Move stdlib tests from src/test/ui-fulldeps to library/std/tests #99417

ChrisDenton opened this issue Jul 18, 2022 · 20 comments
Labels
A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@ChrisDenton
Copy link
Member

ChrisDenton commented Jul 18, 2022

I think std tests should ideally live in the library/std directory but today we have a few that are in src/test/ui-fulldeps.

Tests I think could be moved:

@jyn514
Copy link
Member

jyn514 commented Apr 9, 2023

Looks like create-dir-all-bare and rename-directory were changed to an integration test in #108233.

The rest of these are moving from ui-fulldeps to ui in #109875, but it would still be nice to get them out of tests/ui altogether so they don't require building the compiler.

@jyn514 jyn514 added A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust T-libs Relevant to the library team, which will review and decide on the PR/issue. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Apr 9, 2023
jyn514 added a commit to jyn514/rust that referenced this issue Apr 14, 2023
The `std` test straightforwardly can't work without file descriptors;
 rust-lang#99417 tracks moving it out of tests/ui.

`issue-13560.rs` requires the target to support dynamic linking.

`extern-mod-syntax` is interesting. The original test was added to check
if `extern mod` could be parsed correctly and used `extern mod std` and
an import:
rust-lang@138dc30#diff-73700e1e851b7a37bc92174635dab726124c82e5bfabbbc45b4a3c2e8e14fadd
At some point `std::json::Object` was moved out of std to an unstable
rustc-only `extras` crate, and rather than just changing the import it
got changed to use the unstable crate. When `extras` was removed, people
assumed the test was meant to also test rustc_private and changed it to
another unstable crate rather than using something in std.

This changes the test to remove the `rustc_private` import, to allow it
to work properly when cross-compiling.
@766974616c79
Copy link
Contributor

Hi, is this no longer an issue?

@jyn514
Copy link
Member

jyn514 commented Jun 3, 2023

this is still an issue.

; ls tests/ui/std
issue-15149.rs  issue-81357-unsound-file-methods.rs  stdio-from.rs  switch-stdout.rs

@766974616c79
Copy link
Contributor

issue-81357-unsound-file-methods.rs

OK, is the issue-81357-unsound-file-methods.rs file also included? I'll try to resolve this issue

@766974616c79
Copy link
Contributor

@rustbot claim

@766974616c79
Copy link
Contributor

Hi, I managed to move the switch-stdout.rs file but I have a problem with the stdio-from.rs file, I can't see how to use Stdio without going through the command system? Am I right?

@766974616c79
Copy link
Contributor

After asking on the discord, Stdin is apparently not made for tests so I have no idea how to do it for the stdio-from.rs file

@ChrisDenton
Copy link
Member Author

Sorry I've not been around much lately. I believe I already moved the low hanging fruit with the remaining tests being much more tricky to move. Perhaps they will require changes to testing or maybe it'll never be possible to move them (in which case this issue should be closed as won't fix).

The ultimate goal here would be to run as many std tests as possible when x test library/std is used. Perhaps there's another way to achieve that. Or perhaps it's not worth the effort.

@jyn514
Copy link
Member

jyn514 commented Jun 7, 2023

@MoskalykA I see a library/std/tests folder which holds integration tests - could you move the test there? I think that would allow running it basically without changes, since that's where cargo puts its integration tests :)

@petrochenkov
Copy link
Contributor

There's also a number of tests in tests\ui\stdlib-unit-tests which are standard library unit tests (they were moved there when dismantling the issues subdirectory).

@766974616c79
Copy link
Contributor

766974616c79 commented Jun 7, 2023

Hi, there,
I made a pull request (#112390) for the two moves I managed to make, I can try to add the tests coming from tests\ui\stdlib-unit-tests if you want ? @jyn514

bors added a commit to rust-lang-ci/rust that referenced this issue Jul 28, 2023
…y-to-tests, r=workingjubilee

Move two tests from `tests/ui/std` to `library/std/tests`

Hi, there,
This pull request comes from this issue (rust-lang#99417), sorry I made some mistakes creating the pull request, it's my first one.
@Dylan-DPC
Copy link
Member

@MoskalykA sorry for the delayed response but are you still interested in the other tests that are missing?

@766974616c79
Copy link
Contributor

sorry for the delayed response but are you still interested in the other tests that are missing?

Yes, as suggested by petrochenkov, tests from the tests\ui\stdlib-unit-tests folder should be moved. But would library/std/tests as destination be correct?

@DanielFrantes
Copy link

I can look on it but i need to know what am i supposed to do.

@DanielFrantes
Copy link

@rustbot claim

@DanielFrantes

This comment has been minimized.

@rustbot

This comment has been minimized.

bors added a commit to rust-lang-ci/rust that referenced this issue May 6, 2024
…workingjubilee

Move some stdlib tests from `tests/ui` to `library/std/tests`

Related to rust-lang#99417
@BansalShivanshu
Copy link

Is this issue fully complete? what's remaining? I would love to take over in prompt time!

@jieyouxu
Copy link
Member

Is this issue fully complete? what's remaining? I would love to take over in prompt time!

This is probably what needs investigating at the moment, i.e. the current status of this issue.

@jieyouxu jieyouxu added the E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status label Nov 27, 2024
@ChrisDenton
Copy link
Member Author

Sorry I've not been keeping up with the issue.

I have now checked and it seems there are no longer any std tests in the ui-fulldeps directory so I'm closing this as complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

9 participants