23 Commits

Author SHA1 Message Date
Ed Page
55350fc670 test: Switch from 'exec_with_output' to 'run'
This is a follow up to #14846 which changed `run` to return the
`RawOutput`.

Reasons I didn't "update" some code to the new `run` return value
- We were actually using `ProcessBuilder::exec_with_output` and I didn't
  want to disentangle what it would take to switch to `Execs`
- We did processing on the `Result` and I didn't want to check how that
  could be updated
2024-11-21 13:48:27 -06:00
Ed Page
5b9799c6f4 refactor: Migrate from extern crate to test-support prelude
We now include the prelude in so many places, this simplifies how we can
present how `cargo-test-support` works.

Yes, this included some `use` clean ups but its already painful enough
walking through every test file, I didn't want to do it twice.
2024-07-12 15:57:00 -05:00
Lawrence Chou
8db30bc4bd
Use snapshot generated by SNAPSHOTS=overwrite cargo test 2024-06-15 22:43:11 +08:00
Lawrence Chou
e5e9f2f7c5
Remove [..] and mention #14076 caveat 2024-06-15 15:32:18 +08:00
Lawrence Chou
eef057ea0f
Dedup with cargo_search::help::case (https://github.com/rust-lang/cargo/pull/14060#discussion_r1638479136) 2024-06-15 15:02:37 +08:00
Lawrence Chou
3fd3879bc8
Dedup with cargo::z_help::case (https://github.com/rust-lang/cargo/pull/14060#discussion_r1638481972)
# Conflicts:
#	tests/testsuite/help.rs
2024-06-15 15:02:34 +08:00
Lawrence Chou
3a95c7846d
Revert "Tmp commit prior to SNAPSHOTS=overwrite cargo t --test testsuite help::"
This reverts commit cbaa4a89e60507366401ac0076d652f5eafc4998.
2024-06-15 15:02:14 +08:00
Lawrence Chou
715cba9189
Tmp commit prior to SNAPSHOTS=overwrite cargo t --test testsuite help::
# Conflicts:
#	tests/testsuite/help.rs
2024-06-15 15:02:13 +08:00
Lawrence Chou
7c28d80d37
test: migrate help to snapbox 2024-06-13 23:37:23 +08:00
Ed Page
dc5ac62cab fix(test): Deprecate non-snapbox assertions
While this is noisy and hides other deprecations, I figured deprecations would
make it easier for people to discover what tasks remain and allow us to
divide and conquer this work rather than doing a heroic PR.
In theory, this will be short lived and we'll go back to seeing
deprecations in our tests.
2024-06-10 10:20:52 -05:00
Ed Page
675224b3a0 test(config): Shift to config.toml 2024-01-26 13:40:46 -06:00
Weihang Lo
dbfe4277d3
test: loop over aliases to asser -Zhelp output 2024-01-08 21:34:07 -05:00
Weihang Lo
8fee74d47b
refactor(cli): tweak to align existing style 2024-01-08 21:33:12 -05:00
Weihang Lo
3d4407dcb9
test(cli): snapshot test for -Z help 2024-01-08 21:33:11 -05:00
Sean Stangl
4c66d18361 fix panic if an alias is defined to "" 2021-12-12 13:30:31 -07:00
Sean Stangl
6df4b1ef71 Update behavior to pass-through simple aliases
This changes the behavior so that simple aliases that directly alias a
subcommand (with no arguments) pass-through to that subcommand, while
complex aliases (with arguments) show the alias.

So for example, `cargo help b` will show the manpage for `cargo-build`,
while `cargo help my-alias`, aliased to `build --release`, will show
"`my-alias` is aliased to `build --release`".
2021-12-12 10:18:19 -07:00
Sean Stangl
e77b254923 Update help::help_alias() to assert the new behavior 2021-12-11 15:31:48 -07:00
l00556901
128ed4c964 add test 2021-09-22 11:36:08 +08:00
bors
05d37ae2c0 Fix #9350 (cargo build -Z help is missing options)
> Do not merge yet, some options are still undocumented.

Fix #9350 (cargo build -Z help is missing options)

Add a procedural macro to declare `CliUnstable` struct and provide help messages instead of hard-coding help in `src/bin/cargo/cli.rs`

> Flags documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html

Feedback welcome
2021-04-20 21:58:22 +00:00
Eric Huss
bcfdf9fbad New namespaced features implementation. 2020-10-23 16:04:41 -07:00
Eric Huss
6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Eric Huss
0e26eae5c1 Display embedded man pages for built-in commands. 2020-08-03 12:30:38 -07:00
Eric Huss
9138d65e4c Create a dedicated module for help tests. 2020-08-03 12:17:58 -07:00