22 Commits

Author SHA1 Message Date
Ross Sullivan
92d9a94d02
chore: Migrated testsuite to testsuite::prelude 2025-06-25 22:37:24 +09:00
Lin Yihai
668d82e3f0 fix: trace [env] config table into fingerprint. 2024-10-25 11:21:52 +08:00
Lin Yihai
02d2c77d87 test: add test to describe the issue#13280
Cargo fails to detect environment variable is newly set and rebuild if the environment variable is set in `config.toml`
2024-10-25 11:01:31 +08: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
heisen-li
8c6c8a164e test: migrate cargo_env_config to snapbox 2024-06-26 12:22:29 +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
Ralf Jung
8a7ba8f8d9 Also wrap the initial -vV invocation in the rustc_(workspace_)wrapper
Based on an earlier draft by oli-obk
2024-04-12 12:33:34 +02:00
Ed Page
675224b3a0 test(config): Shift to config.toml 2024-01-26 13:40:46 -06:00
Eric Huss
2dccb71acd Disallow RUSTUP_TOOLCHAIN in the [env] table. 2023-05-08 09:30:59 -07:00
Eric Huss
4ec06f4820 Disallow RUSTUP_HOME in the [env] table. 2023-05-07 10:01:43 -07:00
Weihang Lo
00484fe00a
fix: apply [env] to target info discovery rustc 2023-04-24 20:30:44 +01:00
Weihang Lo
e1c7ce8903
test: [env] isn't applied to target info discovery rustc 2023-04-24 20:28:20 +01:00
Scott Schafer
9c6a044b74 chore: update cargo_env_config test to use check 2023-02-20 12:20:26 -06:00
Basile Henry
17a2bce2f1 config: Improve wording of CARGO_HOME in [env] error 2023-02-01 08:21:03 +01:00
Basile Henry
d09e132622 config: Deny CARGO_HOME in [env] table (fixes #11590) 2023-01-28 12:32:22 +01:00
Scott Schafer
4bc8fe85bd remove unneeded nightly flags from various tests 2022-07-14 19:55:44 -05:00
Josh Triplett
ab38ce0f44 Stabilize [env] sections
`[env]` sections seem to work as advertised.
2021-07-29 19:50:51 -07:00
Martin Donlon
ac05a8526f Don't allow config env to modify vars set by cargo 2021-06-12 08:48:23 -07:00
Martin Donlon
05acf73604 Change env section parsing
`untagged` enum variants are not recognised by serde if the variant contains a `Value<T>` type.
This change uses an transparent "inner" enum `Value<T>` member, which is handled correctly by serde.
2021-02-20 13:49:08 -08:00
Martin Donlon
7990ab53f5 Add -Z configurable-env to gate [env] usage
Added the `-Z configurable-env` option which controls whether the data from the [env] section is used. Updated the tests to pass the flag and to masquerade as the nightly cargo.
2021-02-15 20:21:22 -08:00
Martin Donlon
3aa99422ca Run cargo fmt --all
Fix formatting errors
2021-02-15 15:29:08 -08:00
Martin Donlon
95de3e9fea Add support for [env] section in .cargo/config.toml
This adds support for an `[env]` section in the config.toml files. Environment variables set in this section will be applied to the environment of any processes executed by cargo.

```
[env]
FOOBAR = "Apple"
PATH_TO_SOME_TOOL = { value = "bin/tool", relative = true }
USERNAME = { value = "test_user", force = true }
```
2021-02-15 15:17:00 -08:00