-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Extract tests from libcore to a separate crate #15245
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
Conversation
This is necessary to finish the implementation of RFC 28. @alexcrichton would you be able to handle the makefile updates for this? I got lost in the depths of test.mk. Once libcore isn't built for tests anymore I can cut all of the |
Why couldn't these be moved? |
The structs they were testing are private ( |
Ah, yes, I see that most of the tests (all the "interesting" ones) in |
I don't think it will be easy to have Could these perhaps be moved to one giant run-pass test? Something like:
That would at least involve fewer changes to the makefile infrastructure! Could you also add a comment to the top of libcore (not a doc comment) explaining why there are 0 unit tests in the library itself? |
There's a fair number of dubious It seems like it'd be a bit unfortunate to move it to rpass since I don't think you'd be able to do TESTNAME filtering on it. |
Ok, that makes sense. Another possibility would be a |
@alexcrichton seem reasonable? I still have to strip all of the test cfg-ing from libcore and rebase. |
I'm ok if you filter out |
Should be ready to go (modulo a rebase). Look good other than that? |
@alexcrichton rebased, r? |
I checked r=me if there's a comment somewhere. |
Libcore's test infrastructure is complicated by the fact that many lang items are defined in the crate. The current approach (realcore/realstd imports) is hacky and hard to work with (tests inside of core::cmp haven't been run for months!). Moving tests to a separate crate does mean that they can only test the public API of libcore, but I don't feel that that is too much of an issue. The only tests that I had to get rid of were some checking the various numeric formatters, but those are also exercised through normal format! calls in other tests.
Oh, whoops, updated with a comment in libcore/lib.rs |
Libcore's test infrastructure is complicated by the fact that many lang items are defined in the crate. The current approach (realcore/realstd imports) is hacky and hard to work with (tests inside of core::cmp haven't been run for months!). Moving tests to a separate crate does mean that they can only test the public API of libcore, but I don't feel that that is too much of an issue. The only tests that I had to get rid of were some checking the various numeric formatters, but those are also exercised through normal format! calls in other tests.
Fix missing terminator in pattern matching of consts fix rust-lang#15238
Libcore's test infrastructure is complicated by the fact that many lang
items are defined in the crate. The current approach (realcore/realstd
imports) is hacky and hard to work with (tests inside of core::cmp
haven't been run for months!).
Moving tests to a separate crate does mean that they can only test the
public API of libcore, but I don't feel that that is too much of an
issue. The only tests that I had to get rid of were some checking the
various numeric formatters, but those are also exercised through normal
format! calls in other tests.