-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Unify test code in bootstrap #104198
Comments
@jyn514 Can I work on this issue? |
Sure :) |
So what are the things need to be done. Can you guide me? |
@pratushrai0309 no, sorry, I don't have more time available to work on this issue. If you have specific questions about the things I wrote in the issue description I can answer those. |
@jyn514 So we just have to create a function test_args with the code you have linked in the comment right?? |
That is one part of the work, yes. There is other duplicated code I don't remember off the top of my head, glancing around test.rs should show several examples. But adding and using the function I mentioned would be a good start. |
@rustbot claim |
Not sure if @pratushrai0309 is still working on this, I'll also do some work here @rustbot claim |
bootstrap: Unify test argument handling Fixes rust-lang#104198. Does *not* help with rust-lang#80124 because I couldn't figure out a reasonable way to omit `--lib` only for `panic_abort` and not other `std` dependencies. - Remove unnecessary `test_kind` field and `TestKind` struct. These are just subsets of the existing `builder.kind` / `Kind` struct. - Add a new `run_cargo_test` function which handles passing arguments to cargo based on `builder.config` - Switch all Steps in `mod test` to `run_cargo_test` where possible - Combine several steps into one `CrateBootstrap` step. These tests all do the same thing, just with different crate names. - Fix `x test --no-doc`. This is much simpler after the refactors mentioned earlier, but I'm happy to split it into a separate PR if desired. Before, this would panic a lot because steps forgot to pass `--lib`.
bootstrap: Unify test argument handling Fixes rust-lang#104198. Does *not* help with rust-lang#80124 because I couldn't figure out a reasonable way to omit `--lib` only for `panic_abort` and not other `std` dependencies. - Remove unnecessary `test_kind` field and `TestKind` struct. These are just subsets of the existing `builder.kind` / `Kind` struct. - Add a new `run_cargo_test` function which handles passing arguments to cargo based on `builder.config` - Switch all Steps in `mod test` to `run_cargo_test` where possible - Combine several steps into one `CrateBootstrap` step. These tests all do the same thing, just with different crate names. - Fix `x test --no-doc`. This is much simpler after the refactors mentioned earlier, but I'm happy to split it into a separate PR if desired. Before, this would panic a lot because steps forgot to pass `--lib`.
bootstrap: Unify test argument handling Fixes rust-lang#104198. Does *not* help with rust-lang#80124 because I couldn't figure out a reasonable way to omit `--lib` only for `panic_abort` and not other `std` dependencies. - Remove unnecessary `test_kind` field and `TestKind` struct. These are just subsets of the existing `builder.kind` / `Kind` struct. - Add a new `run_cargo_test` function which handles passing arguments to cargo based on `builder.config` - Switch all Steps in `mod test` to `run_cargo_test` where possible - Combine several steps into one `CrateBootstrap` step. These tests all do the same thing, just with different crate names. - Fix `x test --no-doc`. This is much simpler after the refactors mentioned earlier, but I'm happy to split it into a separate PR if desired. Before, this would panic a lot because steps forgot to pass `--lib`.
bootstrap: Unify test argument handling Fixes rust-lang#104198. Does *not* help with rust-lang#80124 because I couldn't figure out a reasonable way to omit `--lib` only for `panic_abort` and not other `std` dependencies. - Remove unnecessary `test_kind` field and `TestKind` struct. These are just subsets of the existing `builder.kind` / `Kind` struct. - Add a new `run_cargo_test` function which handles passing arguments to cargo based on `builder.config` - Switch all Steps in `mod test` to `run_cargo_test` where possible - Combine several steps into one `CrateBootstrap` step. These tests all do the same thing, just with different crate names. - Fix `x test --no-doc`. This is much simpler after the refactors mentioned earlier, but I'm happy to split it into a separate PR if desired. Before, this would panic a lot because steps forgot to pass `--lib`.
Right now, we copy paste a bunch of code in various places and it ends up with not all test suites supporting the same arguments. See for example #66458. We should refactor all these Steps to use the same logic for the flags to pass to cargo.
rust/src/bootstrap/test.rs
Lines 2448 to 2464 in 131ef95
fn test_args(cargo: &mut Cargo) {}
that we call instead of trying to keep these in sync.Originally posted by @jyn514 in #72536 (comment)
The text was updated successfully, but these errors were encountered: