Skip to content

Add test for cli ui #3205

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

Merged
merged 2 commits into from
Feb 11, 2023
Merged

Add test for cli ui #3205

merged 2 commits into from
Feb 11, 2023

Conversation

0xPoe
Copy link
Member

@0xPoe 0xPoe commented Feb 11, 2023

ref #3064 (comment)

Add ui tests for cli. Then we can try to bump clap's version.

Some notes:

  1. Because of this bug, so we need to use ... to ignore the first line of the subcommand bin name.
  2. Because we don't have the man command on windows, we need to skip the man's test on windows.

@0xPoe 0xPoe force-pushed the rustin-patch-cli-ui branch from 8bf8c7f to 57826e0 Compare February 11, 2023 08:15
@zohnannor zohnannor mentioned this pull request Feb 11, 2023
@0xPoe 0xPoe force-pushed the rustin-patch-cli-ui branch 2 times, most recently from 5686001 to 8014377 Compare February 11, 2023 16:22
rustup-init[EXE] [FLAGS] [OPTIONS]

FLAGS:
-v, --verbose Enable verbose output
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if this will be stable as clap evolves - we may want to do things like

--verbose[...] Enable verbose output : but we can do that if we need to, not right now ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. we can update it if we need to.
Thanks for your review! 💚 💙 💜 💛 ❤️

Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[email protected]>
@0xPoe 0xPoe force-pushed the rustin-patch-cli-ui branch from 8014377 to 0facdf6 Compare February 11, 2023 16:48
@0xPoe 0xPoe requested a review from rbtcollins February 11, 2023 16:57
let rustup = trycmd::cargo::cargo_bin("rustup");
t.register_bin("rustup-init", &rustup_init);
// Copy rustup-init to rustup so that the tests can run it.
fs::copy(&rustup_init, &rustup).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

You could also export RUSTUP_FORCE_ARG0='rust', but the copy is fine.

@rbtcollins rbtcollins merged commit bb88d62 into rust-lang:master Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants