31 Commits

Author SHA1 Message Date
Ross Sullivan
92d9a94d02
chore: Migrated testsuite to testsuite::prelude 2025-06-25 22:37:24 +09:00
usamoi
9dbf5b0b67 do not pass cdylib link args to test 2025-03-19 20:20:45 +08:00
Eric Huss
5516ffa1c3 Add a test for rustc-cdylib-link-arg
We didn't have any tests that included the old `rustc-cdylib-link-arg`
form.
2025-03-18 16:28:09 -07:00
Ed Page
af3cfd5abe fix(test): Un-deprecate contains assertions 2024-11-07 15:55:35 -06:00
Ed Page
a6cf1be655 test: Switch from allow to expect deprecated
This caught a couple of lingering items.
2024-09-23 20:44:06 -05:00
Ed Page
d2ec764995 fix(resolve): Dont show locking workspace members
This is for `cargo generate-lockfile` and when syncing the lockfile with
the manifest.
We still show it for `cargo update` because of `cargo update
--workspace`.

We hacked around this previously by filtering out the `num_pkgs==1` case
for single packages but this didn't help with workspaces.
2024-08-22 16:57:06 -05: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
e41c718229 test: migrate build_script_extra_link_arg to snapbox 2024-06-17 19:31:44 +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
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
831847e5f0 fix(rustc): Always pass --edition to rustc
On [Internals](https://internals.rust-lang.org/t/idea-rustc-cargo-should-warn-on-unspecified-edition/20309),
the idea came up for warning on unset Edition.
I am working on the cargo warning but if rustc ever wants to do so,
they'd be blocked on cargo ensuring `--edition` is always set.
Hence this change.
2024-02-28 15:35:41 -06:00
Ed Page
e7e8d8748a fix(compiler): Clarify we're showing a profile name 2024-02-08 14:01:39 -06:00
hi-rustin
ed9dc44f47 Update other tests to use cargo:: syntax
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-23 13:17:55 +08:00
hi-rustin
25365d904c Use syntax_prefix to improve error message
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-23 13:17:55 +08:00
hi-rustin
9ebe3b332a Extend the build directive syntax with cargo::
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-23 13:17:55 +08:00
Matheus Z Marchiore
380719da35 feat: add package name and version to warning messages 2023-10-11 16:52:30 -03:00
Scott Schafer
22721597f7 remove .masquerade_as_nightly_cargo() from build_script_extra_link_arg.rs 2022-07-14 15:05:33 -05:00
Aviram Hassan
541c908ef6
extra-link-arg-etc: support all link types (credit @davidhewitt) 2022-01-27 21:57:57 +02:00
chansuke
2fabe52ccd Add rustc-link-args to doctest build 2021-10-14 10:24:16 +09:00
Daniel Frampton
e73703944e Stabilize the extra link arg option 2021-07-22 09:57:00 -07:00
Eric Huss
2bcece90a8 Change rustc-cdylib-link-arg error to a warning. 2021-06-09 14:24:12 -07:00
Eric Huss
836e537bc0 Make cargo:rustc-link-arg-bin without the = an error. 2021-05-29 16:12:11 -07:00
Eric Huss
f676b49e52 Add some errors if rustc-link-arg-* specifies a non-existent target. 2021-05-29 16:00:35 -07:00
Dario Nieuwenhuis
160756368f Add test for cargo:rustc-link-arg-bin=foo=--bar 2021-05-20 21:41:17 +02:00
Markus Reiter
9fca62483f Rename rustc-bin-link-arg to rustc-link-arg-bins. 2020-11-09 15:16:32 +01:00
Markus Reiter
5976d53add Fix test on Windows. 2020-11-09 15:16:32 +01:00
Markus Reiter
a8ee4778e8 Remove unneeded verbose flag. 2020-11-09 15:16:32 +01:00
Markus Reiter
b4243dc0cc Rename tests for -Zextra-link-arg. 2020-11-09 15:16:32 +01:00
Markus Reiter
d3454cb14b Add tests and warnings for -Zextra-link-arg. 2020-11-09 15:16:32 +01:00