28 Commits

Author SHA1 Message Date
Ed Page
306d515c08 fix(fingerprint): Don't throwaway the cache on RUSTFLAGS changes
Fixes #8716
2024-12-05 16:11:11 -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
Leon Schuermann
0e35bea6c3 Allow enabling config-include feature in config
Prior to this change, it is not possible to enable the unstable
`config-include` flag from within a config file itself. This is due to
the fact that, while cargo does reload configuration files if this
flag is set, it does not parse the top-level configuration file's
unstable flags before checking whether this flag is present.

This commit forces cargo to load unstable features before this check,
and if the flag is present, re-loads configuration files with
`config-include` enabled.
2024-07-05 20:38:17 -04:00
Leon Schuermann
45e5cb4964 test(add): show config-include correctly merges unstable configs
Co-authored-by: Weihang Lo <me@weihanglo.tw>
2024-07-05 20:38:10 -04:00
Leon Schuermann
8bfc31f975 test(add): show config-include cannot be enabled in top-level config 2024-07-05 20:37:55 -04:00
eth3lbert
91569f84b0
test: Add auto-redaction for not found error 2024-06-22 05:13:58 +08: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
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
Weihang Lo
33b0a24082
test(config-include): assert config merged in DFS 2023-06-21 20:18:09 +01:00
Weihang Lo
3f82ec7093
feat: check if config-include file ends with .toml
This is to avoid possible name collisions. For example, a user
creates a file called `.cargo/cache`, and then in the future
cargo wants to create a directory called `.cargo/cache/`, that
would collide with what the user specified. Restricting to `.toml`
extensions would avoid that since we won’t make a directory named
with a `.toml` extension.
2023-06-21 20:18:08 +01:00
Scott Schafer
6d429b04b9 chore: update config_include tests to use check 2023-02-20 12:20:46 -06:00
Dinu Blanovschi
0beb5fe93d Simple explanations for why cargo rebuilds crates 2022-12-28 16:27:50 +01:00
Weihang Lo
e0502e4e78
test(config-include): fix typo
Co-authored-by: Jon Gjengset <jon@thesquareplanet.com>
2022-10-09 16:14:20 +08:00
Weihang Lo
e997fbc794
test(config_include): take priority over env when loaded from cli 2022-09-16 15:36:44 +01:00
Scott Schafer
c239e407e7 add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05: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
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
1372afc6bd Fix up config_include test 2021-12-14 19:39:03 -08:00
Eric Huss
1130bc076f Fix config includes not working. 2021-03-24 20:21:09 -07:00
Eric Huss
80e55c774b Fix tests with enoent error message on non-english systems. 2020-05-29 12:34:17 -07:00
Eric Huss
1d5d7a269f Support --config path_to_config.toml cli syntax. 2020-02-18 09:30:27 -08: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
00a47302dd Fixes for some test errors on Windows. 2019-12-19 09:44:02 -08:00
Eric Huss
e7eda2f91f Implement config-include. 2019-12-19 09:44:02 -08:00