94 Commits

Author SHA1 Message Date
eth3lbert
ea04b5c483
test: migrate features to snapbox 2024-06-19 18:12:43 +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
8520ec63b6 test(toml): Centralize underscore field tests 2024-04-18 14:38:05 -05:00
Ed Page
3fc52d53b1 test(toml): Make test names scale to more scenarios 2024-04-18 14:35:39 -05:00
Ed Page
1876326b6b feat(resolve): Tell the user the style of resovle done
This is to help with #9930

Example changes:
```diff
-[LOCKING] 4 packages
+[LOCKING] 4 packages to latest version
-[LOCKING] 2 packages
+[LOCKING] 2 packages to latest Rust 1.60.0 compatible versions
-[LOCKING] 2 packages
+[LOCKING] 2 packages to earliest versions
```

Benefits
- The package count is of "added" packages and this makes that more
  logically clear
- This gives users transparency into what is happening, especially with
  - what rust-version is use
  - the transition to this feature in the new edition
  - whether the planned config was applied or not (as I don't want it to
    require an MSRV bump)
- Will make it easier in tests to show what changed
- Provides more motiviation to show this message in `cargo update` and
  `cargo install` (that will be explored in a follow up PR)

This does come at the cost of more verbose output but hopefully not too
verbose.  This is why I left off other factors, like avoid-dev-deps.
2024-04-13 20:39:59 -05:00
Ed Page
4ab2797f36 feat(lock): Print lockfile changes on all commands 2024-03-12 13:39:56 -05:00
Ed Page
14646e6af6 test: Make edition explicit on packages 2024-02-22 11:37:03 -06:00
Ed Page
e7e8d8748a fix(compiler): Clarify we're showing a profile name 2024-02-08 14:01:39 -06:00
Scott Schafer
0d62ae2fc3
feat: Add rustc style errors for manifest parsing 2023-12-15 13:30:10 -07:00
Weihang Lo
a3267bfa29
refactor(util-schemas): error type for restricted_names 2023-12-20 10:38:02 -05:00
Ed Page
c1d9b76401 fix: Improve feature name errors
This moves feature name validation early enough in the process to get
TOML errors.
2023-12-13 10:53:40 -06:00
Eric Huss
0afd943dad Fix some test output validation. 2023-11-15 15:10:18 -08:00
bors
2ef56214b3 Auto merge of #12939 - hi-rustin:rustin-patch-feature-msg, r=epage
Fix the invalidate feature name message
2023-11-08 17:15:01 +00:00
hi-rustin
976835d045 Update the test for the msg change
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-11-08 23:40:24 +08:00
hi-rustin
d61816465f Add test for empty feature name
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-11-08 22:52:35 +08:00
David Tolnay
649a14d470
Add regression test for issue 6915: features and transitive dev deps 2023-11-01 14:22:16 -07:00
Eric Huss
9835622853 Convert valid feature name warning to an error. 2023-06-20 12:39:27 -07:00
Scott Schafer
a5ec7e0266 chore: update features tests to use check 2023-02-20 12:21:15 -06:00
Dinu Blanovschi
2071acd5ec Add -v to some feature tests 2022-12-28 18:44:05 +01:00
Scott Schafer
ab18bd40d5 refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
Scott Schafer
cda5f82498 add preloading for workspace packages in resolve_with_previous so manifests aren't parsed twice 2022-06-16 15:34:22 -05:00
hi-rustin
8b895cc80b Use warn_on_deprecated
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-03-10 00:08:28 +08:00
hi-rustin
460ea25377 Warning on conflicting default_features keys
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-03-09 23:16:38 +08:00
Eric Huss
43a063c80a Stabilize namespaced and weak dependency features. 2022-01-06 15:56:56 -08:00
Eric Huss
85854b1884 Refactor feature handling, and improve error messages. 2021-03-19 14:59:53 -07:00
Eric Huss
d087aeb845 Stabilize -Zfeatures and -Zpackage-features. 2020-12-19 08:26:42 -08:00
Eric Huss
ea1a73a121 Add period to allowed feature name characters. 2020-12-02 07:56:44 -08:00
Eric Huss
b731190daa Add a future-compatibility warning on allowed feature name characters. 2020-10-27 14:23:35 -07:00
Eric Huss
bcfdf9fbad New namespaced features implementation. 2020-10-23 16:04:41 -07:00
Eric Huss
2611f5c73c Move namespaced features tests to a separate file. 2020-10-23 16:04:41 -07:00
Ivan Tham
fd5902c6ca
Fix help message in features.rs test 2020-10-14 10:21:37 +08:00
Eric Huss
6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Alex Tokarev
19a9579031 Warn on missing required-features
Co-authored-by: Eric Huss <eric@huss.org>
2020-07-26 13:01:18 +03:00
Alex Crichton
6514c289d2 Improve git error messages a bit
This commit is targeted at further improving the error messages
generated from git errors. For authentication errors the actual URL
fetched is now printed out as well if it's different from the original
URL. This should help handle `insteadOf` logic where SSH urls are used
instead of HTTPS urls and users can know to track that down.

Otherwise the logic about recommending `net.git-fetch-with-cli` was
tweaked a bit and moved to the same location as the rest of our error
reporting.

Note that a change piggy-backed here as well is that `Caused by:` errors
are now automatically all tabbed over a bit instead of only having the
first line tabbed over. This required a good number of tests to be
updated, but it's just an updated in renderings.
2020-06-25 08:47:15 -07:00
Eric Huss
ab73b2c35c Fix order-dependent feature resolution. 2020-06-21 17:28:36 -07:00
Eric Huss
4ae79d2ffd Use fs helpers instead of File functions. 2020-04-17 07:56:16 -07:00
Eric Huss
54ace8af65 Merge -Zpackage-features2 and -Zpackage-features. 2020-04-08 14:06:09 -07:00
Eric Huss
7caa1612cf Add new feature resolver. 2020-02-20 12:04:28 -08:00
Jonas Platte
2166db8c49
Add a note to the error message for using --feature / --no-default-features in a virtual workspace 2019-12-24 14:46:16 +01:00
Eric Huss
83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
Eric Huss
4d524ea57b Allow --all-features in root of virtual workspace. 2019-10-18 09:39:58 -07:00
Eric Huss
bf474ba589 Reject feature flags in a virtual workspace. 2019-10-14 12:40:14 -07:00
Alex Crichton
1fa02e77b6 Fix interpretation of --features a b on the CLI
Fixes an accidental regression from #7084 where `--features a b` was
erroneously mistinterpreted as `--features "a b"`.

Closes #7418
2019-09-24 09:24:47 -07:00
Alex Crichton
9115b2c326 Extract support directory to its own crate
Extract out all our test support code to its own standalone crate so it
can be shared between multiple test suites if necessary.
2019-09-16 11:47:09 -07:00
Eric Huss
ecf824f7b2 Update additional uses of --all.
- man pages
- Slightly reword deprecation notice.
- Include --all in man pages.
- Update some additional usages in code and docs.
2019-09-03 17:51:07 -07:00
k-nasa
7176df01d6 Change --all to --workspace 2019-09-03 17:14:34 -07:00
Eric Huss
88d3b4ce42 Remove debug panic in package-features. 2019-08-05 08:44:13 -07:00
bors
10776bdde3 Auto merge of #7084 - scruffystuffs:invoke-feature-multi, r=alexcrichton
Add support for multiple --features options

Closes #7076

Pretty straightforward, but I added an extra test to make sure that space-separated features work in conjunction with multiple --features options.
2019-07-19 13:56:28 +00:00
Eric Huss
a4e9611453 Fix some formatting for some strings. 2019-07-13 16:00:47 -07:00
Wesley Van Melle
51c26b6776 Add support for multiple --features options 2019-07-01 15:29:38 -07:00