208 Commits

Author SHA1 Message Date
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
Toothbrush
c973a6d0af
rustfmt 2021-06-29 18:18:28 +01:00
Toothbrush
684391e444
Change if cfg!(..) { } to #[cfg!(..)] { }
This fixes builds on non-Windows platforms.
2021-06-29 17:19:14 +01:00
Toothbrush
f1c8e56909
Format exclude_from_content_indexing 2021-06-28 21:45:59 +01:00
Toothbrush
9d96a88961
Exclude target from content-indexing on Windows
This has a noticeable performance improvement for most projects, especially when the storage device is a hard drive.

Closes #8694
2021-06-28 20:12:44 +01:00
Eric Huss
c0dca04f49 Disambiguate is_symlink. 2021-06-19 11:27:14 -07:00
Tomasz Miąsko
8df771f381 Avoid quadratic complexity when splitting output into lines
When searching for newlines in a process output keep track which part of
buffer was already examined to avoid processing the same data again and
again.
2021-06-18 20:00:55 +02:00
Tomasz Miąsko
9f60fcacaf Simplify line splitting code in exec_with_streaming NFC 2021-06-18 20:00:55 +02: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
David Tolnay
396bdd3a89
Remove parsing of broken version syntax from 5 years ago 2021-05-26 14:37:39 -07:00
bors
070e459c2d Auto merge of #9468 - PaulDance:fix-rustdoc-warnings, r=ehuss
Fix rustdoc warnings

Change some small parts of the unit documentation in order to resolve warnings emitted when running `cargo doc` from the root of this project. It should help reduce the noise when checking that new or updated documentation builds correctly.

See the commit messages for details about the modifications themselves, although they should be rather simple.

Cheers,
Paul.
2021-05-11 18:12:23 +00: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
Paul Mabileau
9ea1cbdeda
Fix doc warnings for cargo-util::paths
Add parentheses to disambiguate from `write!`.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2021-05-09 19:47:08 +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
bors
fb45eb132e Auto merge of #9292 - ehuss:cargo-util, r=alexcrichton
Split out cargo-util package for cargo-test-support.

This splits out code from `cargo` that was being used by `cargo-test-support` in order to remove the dev-dependency cycle on the `cargo` crate. The intent here is to improve development build times. On my system, `touch src/cargo/lib.rs ; cargo check --profile=test` goes from 6.4 seconds to 3.5. I suspect more substantial changes (more than just `touch`) should exhibit even more improvements.

This has a substantial downside that it is another package to manage publishing, particularly with making sure the version is updated correctly for crates.io. I'm uncertain if on balance it is worth it, but I lean towards moving forward with it.
2021-03-22 14:11:51 +00:00
Eric Huss
378b086f2c Fix redundant_semicolons warning in resolver-tests. 2021-03-20 17:44:08 -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
1dae5acb7d Move paths 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
Eric Huss
669340333a Split util code into a separate package. 2021-03-20 15:15:54 -07:00
Kornel
3f7f0942cd track_caller on custom assert functions 2021-03-03 17:17:07 +00:00
bors
b219f0eb7a Auto merge of #9181 - jyn514:computer-says-no, r=ehuss
Forbid setting `RUSTC_BOOTSTRAP` from a build script on stable

Instead, recommend `RUSTC_BOOTSTRAP=crate_name`. If cargo is using a nightly toolchain, or if RUSTC_BOOTSTRAP was set in *cargo*'s build environment, the error is downgraded to a warning, since the variable won't affect the build.

This is mostly the same as suggested in https://github.com/rust-lang/cargo/issues/7088#issuecomment-713867773, except that `RUSTC_BOOTSTRAP=` values other than 1 are treated the same as `RUSTC_BOOTSTRAP=1`. My reasoning was that https://github.com/rust-lang/rust/pull/77802 is now on 1.50 stable, so some crates may have started using it, and I would still prefer not to give hard errors when there's no workaround.

Closes https://github.com/rust-lang/cargo/issues/7088.

r? `@joshtriplett`
2021-03-03 03:19:33 +00:00