Repository navigation
libtest: Allow passing --test-threads and --color multiple times, with later arguments overriding earlier - #161312
Conversation
|
r? @clarfonthey rustbot has assigned @clarfonthey. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Looks good from my side. Starting fcp for this as it is a one-way door. @rfcbot fcp merge testing-devex |
|
@epage has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Cargo would like to be able to pass `--test-threads=N`, without breaking the ability for the user to do the same and override cargo's value. Currently, the option only allows one instance, failing if it sees multiple. Accept `--test-threads=N` multiple times, and have the last instance win.
Cargo would like to be able to pass a `--color` option, without breaking the ability for the user to do the same and override cargo's value. Currently, the option only allows one instance, failing if it sees multiple. Accept `--color` multiple times, and have the last instance win.
61bf561 to
ef65ece
Compare
|
@rfcbot reviewed |
| fn get_test_threads(matches: &getopts::Matches) -> OptPartRes<Option<usize>> { | ||
| let test_threads = match matches.opt_str("test-threads") { | ||
| Some(n_str) => match n_str.parse::<usize>() { | ||
| let mut last_test_threads = None; |
There was a problem hiding this comment.
Non-blocking not-important note: this could be done with a map(...).last() instead of this setup, but it doesn't actually matter imho.
Ditto for below.
There was a problem hiding this comment.
Actually, I realise why you did this, since it's actually more complicated. It'd have to be try_fold instead which is just more confusing.
|
r=me for code review once FCP passes. |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
|
@bors r+ |
Rollup merge of #161312 - joshtriplett:libtest-multi, r=clarfonthey libtest: Allow passing --test-threads and --color multiple times, with later arguments overriding earlier Cargo would like to be able to pass these arguments, without breaking the ability for the user to do the same and override cargo's value. Currently, the option only allows one instance, failing if it sees multiple. Accept `--test-threads=N` and `--color=...` multiple times, and have the last instance win.
Cargo would like to be able to pass these arguments, without breaking the ability for the user to do the same and override cargo's value. Currently, the option only allows one instance, failing if it sees multiple.
Accept
--test-threads=Nand--color=...multiple times, and have the last instance win.