Match any error when failing to find executables

For Windows targets, Rust now uses a custom resolver to find `process::Command` programs. This has caused some error messages to change.

To allow it to be merged, some tests have been adjusted to match any error.
This commit is contained in:
Chris Denton 2021-11-17 11:03:31 +00:00
parent e475fe4a17
commit 93bcd97fc1
No known key found for this signature in database
GPG key ID: 713472F2F45627DE
2 changed files with 11 additions and 8 deletions

View file

@ -403,13 +403,16 @@ fn libexec_path() {
.masquerade_as_nightly_cargo() .masquerade_as_nightly_cargo()
.with_status(101) .with_status(101)
.with_stderr( .with_stderr(
// FIXME: Update "Caused by" error message once rust/pull/87704 is merged.
// On Windows, changing to a custom executable resolver has changed the
// error messages.
&format!("\ &format!("\
[UPDATING] [..] [UPDATING] [..]
[ERROR] failed to execute `[..]libexec/cargo-credential-doesnotexist[EXE]` to store authentication token for registry `crates-io` [ERROR] failed to execute `[..]libexec/cargo-credential-doesnotexist[EXE]` to store authentication token for registry `crates-io`
Caused by: Caused by:
{} [..]
", cargo_test_support::no_such_file_err_msg()), "),
) )
.run(); .run();
} }

View file

@ -1,8 +1,6 @@
//! Tests for configuration values that point to programs. //! Tests for configuration values that point to programs.
use cargo_test_support::{ use cargo_test_support::{basic_lib_manifest, project, rustc_host, rustc_host_env};
basic_lib_manifest, no_such_file_err_msg, project, rustc_host, rustc_host_env,
};
#[cargo_test] #[cargo_test]
fn pathless_tools() { fn pathless_tools() {
@ -271,6 +269,9 @@ fn custom_runner_env() {
p.cargo("run") p.cargo("run")
.env(&key, "nonexistent-runner --foo") .env(&key, "nonexistent-runner --foo")
.with_status(101) .with_status(101)
// FIXME: Update "Caused by" error message once rust/pull/87704 is merged.
// On Windows, changing to a custom executable resolver has changed the
// error messages.
.with_stderr(&format!( .with_stderr(&format!(
"\ "\
[COMPILING] foo [..] [COMPILING] foo [..]
@ -279,9 +280,8 @@ fn custom_runner_env() {
[ERROR] could not execute process `nonexistent-runner --foo target/debug/foo[EXE]` (never executed) [ERROR] could not execute process `nonexistent-runner --foo target/debug/foo[EXE]` (never executed)
Caused by: Caused by:
{} [..]
", "
no_such_file_err_msg()
)) ))
.run(); .run();
} }