27 Commits

Author SHA1 Message Date
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
d1t2
bd451d0ac0 test: Migrate tests/testsuite/co*.rs to snapbox
Part of #14039
2024-06-15 17:45:21 +00: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
3054936cab refactor: Port from assert_matches_exact to assert_e2e
This leaves off `validate_crate_contents` as that would be an effort on
its own
2024-05-29 14:08:10 -05:00
Ed Page
4ce2b61f2a Revert "fix(context): Configure Shell before emitting messages"
This reverts commit f525e1f383fc0d0a7adbdfb1bac6d6228ae79b33.

This removes color control from warnings for unstable features.
For some reason this removed color support from `cargo -Zhelp` in the
tests but I can't reproduce it locally.

The most important thing was getting the config fix in.
There are two follow ups
- Can we have the config working *and* color?
- Why did this fail for this field and not the others we already had
  tests for?

I ran out my immediate time box for looking into these.

Fixes #13991
2024-05-31 14:56:18 -05:00
Ed Page
c0a79574ef test(config): Show current git-fetch-with-cli behavior 2024-05-31 14:56:12 -05:00
Weihang Lo
950aa4e983
test: remove duplicate assertion functions 2024-05-07 14:24:43 -04:00
Ed Page
67b5aa4205 refactor(context): Rename config mod to context 2024-02-29 16:08:08 -06:00
Scott Schafer
305efa63cc
chore: Rename Config to GlobalContext 2024-02-20 11:55:15 -07:00
Ed Page
675224b3a0 test(config): Shift to config.toml 2024-01-26 13:40:46 -06:00
Arlo Siemsen
687ace1ddc Merge higher precedence config lists later
When merging configuration lists, the current order does not match
the expected precedence. This makes merged lists follow precedence
order, with higher precedence items merged later in lists.
2023-08-16 11:21:38 -05:00
Ed Page
6007f05a85 chore: Update to toml v0.6, toml_edit v0.18
`toml` replaces `toml_edit::easy`, using `toml_edit` as its parser.
2023-01-19 15:26:28 -06:00
Ed Page
ed8b85f10e chore: Fix typos 2023-01-10 20:03:11 -06:00
Jacob Finkelman
d8df1425ea unstable_cli_options 2022-12-12 17:51:21 +00:00
Weihang Lo
fafb8a9dac
test(config_cli): multi-occurrence cli args with paths 2022-09-16 15:32:00 +01:00
Jon Gjengset
39c3173619 Stabilize --config
FCP
https://github.com/rust-lang/cargo/issues/7722#issuecomment-1114369809

Closes #7722.
2022-06-17 22:46:04 +00:00
Jon Gjengset
10c4f32682 Disallow setting registry tokens with --config
As per the concern `restricted-values` in
https://github.com/rust-lang/cargo/issues/7722#issuecomment-1101784126.
2022-04-19 09:43:25 -07:00
Jon Gjengset
51917b450d Enforce no decorators in --config values 2022-01-24 12:05:12 -08:00
Jon Gjengset
f962ec1f44 Merge remote-tracking branch 'upstream/master' into config-cli-simple 2022-01-20 12:31:35 -08:00
Ed Page
320c279f43 Port cargo from toml-rs to toml_edit
Benefits:
- A TOML 1.0 compliant parser
- Unblock future work
  - Have `cargo init` add the current crate to the workspace, rather
    than error
  - #5586: Upstream `cargo-add`
2022-01-13 09:27:27 -06:00
Jon Gjengset
934d2d63f5 Use toml_edit to check dotted key for --config 2021-12-14 14:25:32 -08:00
Jon Gjengset
18871b3394 Merge remote-tracking branch 'upstream/master' into config-cli-simple 2021-12-14 12:16:59 -08:00
Jon Gjengset
80fbfed287 Check --config for dotted keys only
This addresses the remaining unresolved issue for `config-cli` (#7722).
2021-12-06 13:25:53 -08:00
Steven Joruk
ed9ec388fd Support term.quiet configuration
This matches how users can specify `--verbose` on the command line, or
`term.verbose` in the configuration.
2021-12-03 06:25:02 +00:00
Alex Crichton
3a18c89a55 Migrate from the failure crate to anyhow
The `anyhow` crate interoperates with the `std::error::Error` trait
rather than a custom `Fail` trait, and this is the general trend of
error handling in Rust as well.

Note that this is mostly mechanical (sed) and intended to get the test
suite passing. As usual there's still more idiomatic cleanup that can
happen, but that's left to later commits.
2020-01-07 16:50:09 -08:00
Eric Huss
e7eda2f91f Implement config-include. 2019-12-19 09:44:02 -08:00
Eric Huss
91015d52ce Add --config CLI option. 2019-12-19 09:44:02 -08:00