427 Commits

Author SHA1 Message Date
Nipunn Koorapati
dde290e6ff Refactor fake_file() away from cargo_command tests
There are already similar preexisting test helpers which
also work on windows. Port over the executable-creation
helper into the file() helper and things appear to pass.
2021-08-05 19:09:58 -07:00
Eric Huss
b67454c660 Make it easier to run testsuite with a custom toolchain. 2021-07-11 14:02:47 -07:00
Eric Huss
28c3bef71a Include the linker in the fingerprint. 2021-07-01 20:33:48 -07:00
Eric Huss
c0dca04f49 Disambiguate is_symlink. 2021-06-19 11:27:14 -07:00
Eric Huss
16b5402fd7 testsuite: Switch to colored diffs with Myers diff. 2021-06-16 15:43:29 -07:00
Eric Huss
205148e645 Only normalize paths on windows.
I don't trust that all these transformations won't have unintended
consequences on other platforms. It is nice to verify there aren't any
backslash shenanigans on other platforms.
2021-06-16 10:35:26 -07:00
Eric Huss
aea5ca3ca0 Remove the double-backslash escape for matching.
Using `with_json` is safer since it knows what JSON escaping is.
2021-06-16 09:44:29 -07:00
Eric Huss
b73e3d4fa5 Don't export lines_match.
Use better high-level interfaces to achieve the same thing.
2021-06-16 09:44:29 -07:00
Eric Huss
24b8936c20 Remove normalized_lines_match, it is not needed. 2021-06-16 09:44:29 -07:00
Eric Huss
6dff99781d Remove with_either_contains.
It isn't needed anymore, and I would prefer to not keep around unused code.
It can always be added back if ever needed again.
2021-06-16 09:44:29 -07:00
Eric Huss
e132bb53ab Move comparison and diffing code to a new module.
This includes various minor refactorings to try to clean things up
and provide better error messages.
2021-06-16 09:44:29 -07:00
Eric Huss
0f5deb64f9 testsuite: Support anyhow error chains in error messages.
This is intended to help with adding more usage of anyhow in the
testsuite, which can help show context for errors.

This also includes some small improvements to the error messages to
provide more information.
2021-06-16 09:44:28 -07:00
Eric Huss
2021865d88 Remove some unused code. 2021-06-15 15:38:02 -07:00
Eric Huss
393077f968 Add run_json to Execs.
This is a helper to run the process and return a JSON object.
2021-06-11 16:07:20 -07:00
Eric Huss
3be34cb834 Remove "Expected: execs" from testsuite error.
That message was not helpful.
2021-06-11 15:25:50 -07:00
Eric Huss
0f304ca450 Fix verify_checks_output.
This was accidentally broken in
cc5e9df64a
causing it to not check in the error case (which is the only case that mattered).
2021-06-11 13:12:30 -07:00
Eric Huss
5d1b0f9c43 Switch cargo-test-support to anyhow. 2021-06-11 12:37:27 -07:00
Eric Huss
7b229bbe39 Move the rustc-echo-wrapper to be shared across tests.
This helps avoid rebuilding the same project several times.
2021-06-09 17:13:33 -07:00
Weihang Lo
df82a44f9e
refactor: extract common make_dep_path to cargo_util 2021-06-01 11:14:53 +08:00
Paul Mabileau
a5b4b4710a
Bump url to 2.2.2 where Into<String> for Url is used
The base package, `cargo-test-support` and `mdman`.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2021-05-10 22:20:11 +02:00
Paul Mabileau
c021ba9acf
Fix Url::into_string deprecation warning
`url::Url::into_string` is deprecated. The `Into<String>` implementation
is now used.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2021-05-10 22:19:00 +02:00
Vojtech Kral
53343bc398 Use CARGO_TARGET_TMPDIR in integration tests if available 2021-05-07 00:03:01 +02:00
Léo Gaspard
731d881a60 handle review comments 2021-04-24 19:12:52 +02:00
Léo Gaspard
5e11afc1ab Expose build.target .cargo/config setting as packages.target in Cargo.toml 2021-04-24 19:12:52 +02:00
Eric Huss
10eb56f2c4 Update clippy lint allow set. 2021-04-13 09:02:07 -07:00
bors
7204d3989d Auto merge of #9302 - ehuss:cargo-config, r=alexcrichton
Add `cargo config` subcommand.

This adds an initial version of the `cargo config` command as discussed in #2362.

Closes #2362
2021-03-30 19:07:19 +00:00
Alex Crichton
a4f0988ef8 Default macOS targets to unpacked debuginfo
This commit continues the work from #9112 to enable `unpacked` split
debuginfo on macOS targets by default. This has been discussed on [internals]
for awhile now and no breakage has emerged while significant speedups
have. This is expected to be a compile-time and `target`-directory size
win for almost all macOS Rust projects.

While breakage is possible it's possible to mitigate this with
project-local or global cargo configuration of the `dev` and `test` profiles.

[internals]: https://internals.rust-lang.org/t/help-test-faster-incremental-debug-macos-builds-on-nightly/14016/9
2021-03-26 07:38:17 -07:00
Eric Huss
96a5642217 Add cargo config subcommand. 2021-03-25 13:52:31 -07:00
Eric Huss
c840160a6d Remove the dev-dependency cycle on cargo. 2021-03-20 17:42:42 -07:00
Eric Huss
0fb35e3129 Remove cargo:: link. 2021-03-20 17:42:42 -07:00
Eric Huss
565591f6e9 Remove use of CRATES_IO_INDEX in cargo-test-support.
Unfortunate duplication of the string, but I think it is unlikely
to have any consequences.
2021-03-20 17:42:41 -07:00
Eric Huss
0ad3fb1b57 Remove CargoResult from cargo-test-support. 2021-03-20 17:42:41 -07:00
Eric Huss
10224938bf Remove use of Rustc from cargo-test-support.
cargo-test-support wasn't using any of the caching or other logic from
Rustc, so this just swaps with a very basic implementation in order to
remove the dependency on `cargo`.
2021-03-20 17:42:41 -07:00
Eric Huss
4aa1ec2419 Move Sha256 to cargo-util. 2021-03-20 17:42:41 -07:00
Eric Huss
dbfdd49559 Move is_ci to cargo-util. 2021-03-20 17:42:32 -07:00
Eric Huss
888100352a Move ProcessBuilder to cargo-util. 2021-03-20 15:19:03 -07:00
Kornel
3f7f0942cd track_caller on custom assert functions 2021-03-03 17:17:07 +00:00
bors
6780fbd22a Auto merge of #9207 - ehuss:testsuite-splitdebug, r=Eh2406
testsuite: Use split debuginfo on macos.

This switches the testsuite to use "unpacked" debuginfo on macos, which is a substantial performance boost. On my system, the testsuite runs 1.55 times faster with this change.  Along with #9206, total testsuite time is 3.1 times faster.
2021-02-25 19:06:49 +00:00
Eric Huss
c73765f9c3 testsuite: Improve performance when using rustup. 2021-02-25 09:07:48 -08:00
Eric Huss
0f78dbd38e testsuite: Use split debuginfo on macos. 2021-02-25 09:06:11 -08:00
bors
8eb0e9a855 Auto merge of #9184 - ehuss:fix-next-edition, r=alexcrichton
Updates to edition handling.

This introduces some updates for edition handling (split into commits for review).  In short:

* `cargo-features = ["edition2021"]` can be used to opt-in to 2021 support without needing to pass around `-Z unstable-options`. I tried to emphasize in the docs that this is only for testing and experimentation.
* Make `"2"` the default resolver for 2021 edition.
* Make `cargo fix --edition` mean the "next" edition from the present one, and support 2021. Also, if already at the latest edition, generate a warning instead an error.
* I decided to allow `cargo fix --edition` from 2018 to 2021 on the nightly channel without an explicit opt-in. It's tricky to implement with an opt-in (see comment in diff).

Partial for #9048.
Fixes #9047.
2021-02-23 21:35:42 +00:00
Eric Huss
3f2f7e30ff Add a migrating message for cargo fix --edition.
This helps indicate which edition you are moving from and to.
2021-02-17 21:36:28 -08:00
Eric Huss
820537c706 Change Fixing to Fixed, and add a verbose "Fixing".
What was previously "Fixing" was a message for after the fixes had
been applied. I think it would be clearer if it said "Fixed",
to indicate that the fixes had actually finished.

The new "Fixing" is posted just before it starts. This is verbose-only
since it is a little noisy.
2021-02-17 20:41:38 -08:00
Eric Huss
be28b58b45 Add features2 to the index. 2021-02-10 11:15:19 -08:00
Eric Huss
196673bb1e Add a schema version to the index. 2021-02-10 10:58:07 -08:00
bjorn3
f5a3d55983 Fix warnings of the new non_fmt_panic lint 2021-02-06 19:10:42 +01:00
Eric Huss
33f648ab3b Fix permission issue with cargo vendor. 2021-02-03 17:37:00 -08:00
bors
aaaf296ab7 Auto merge of #9112 - alexcrichton:split-debuginfo, r=ehuss
Add split-debuginfo profile option

This commit adds a new `split-debuginfo` option to Cargo compilation
profiles which gets forwarded to the `-Csplit-debuginfo` codegen option
in rustc. This commit also sets the default, only on macOS, to be
`-Csplit-debuginfo=unpacked`. The purpose of this change is to leverage
rust-lang/rust#79570 to avoid running `dsymutil` on incremental builds
while also preserving a pleasant debugging experience by default. This
should lead to much faster incremental build times on macOS since
`dsymutil` isn't exactly the speediest tool in the world.

This is technically a breaking change in Cargo because we're no longer
by-default producing the `*.dSYM` folders on macOS. If those are still
desired, however, authors can always run `dsymutil` themselves or
otherwise configure `split-debuginfo = 'packed'` in their
manifest/profile configuration.
2021-02-03 22:50:15 +00:00
Eric Huss
340656e29d Add RegistryBuilder to help initializing test registries.
The intent here is to make it more flexible to create different registry
setups, and to reuse code a little more easily.
2021-02-02 15:48:48 -08:00
Alex Crichton
cc5e9df64a Cache failures in the rustc info cache
This commit updates the rustc info cache to cache failures to execute
rustc as well as successes. This fixes a weird issue where if you're
probing for flags the `rustc_info_cache` test fails on channels which
don't have the flag since previously a failure to execute rustc resulted
in never caching the result.
2021-02-01 11:29:25 -08:00