Skip to content
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

Add test for cli ui #3205

Merged
merged 2 commits into from Feb 11, 2023
Merged

Conversation

hi-rustin
Copy link
Member

@hi-rustin hi-rustin 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.

@zohnannor zohnannor mentioned this pull request Feb 11, 2023
@hi-rustin hi-rustin force-pushed the rustin-patch-cli-ui branch 2 times, most recently from 5686001 to 8014377 Compare February 11, 2023 16:22
src/utils/utils.rs Outdated Show resolved Hide resolved
tests/cli-ui.rs Outdated Show resolved Hide resolved
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 <rustin.liu@gmail.com>
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
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.

None yet

2 participants