Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiletest: Don't swallow some error messages. #115943

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ impl<'test> TestCx<'test> {
}

fn run_command_to_procres(&self, cmd: &mut Command) -> ProcRes {
let output = cmd.output().unwrap_or_else(|_| panic!("failed to exec `{cmd:?}`"));
let output = cmd.output().unwrap_or_else(|e| panic!("failed to exec `{cmd:?}`: {e:?}"));

let proc_res = ProcRes {
status: output.status,
Expand Down Expand Up @@ -1216,12 +1216,12 @@ impl<'test> TestCx<'test> {
.arg(&exe_file)
.arg(&self.config.adb_test_dir)
.status()
.unwrap_or_else(|_| panic!("failed to exec `{:?}`", adb_path));
.unwrap_or_else(|e| panic!("failed to exec `{adb_path:?}`: {e:?}"));

Command::new(adb_path)
.args(&["forward", "tcp:5039", "tcp:5039"])
.status()
.unwrap_or_else(|_| panic!("failed to exec `{:?}`", adb_path));
.unwrap_or_else(|e| panic!("failed to exec `{adb_path:?}`: {e:?}"));

let adb_arg = format!(
"export LD_LIBRARY_PATH={}; \
Expand All @@ -1238,7 +1238,7 @@ impl<'test> TestCx<'test> {
.stdout(Stdio::piped())
.stderr(Stdio::inherit())
.spawn()
.unwrap_or_else(|_| panic!("failed to exec `{:?}`", adb_path));
.unwrap_or_else(|e| panic!("failed to exec `{adb_path:?}`: {e:?}"));

// Wait for the gdbserver to print out "Listening on port ..."
// at which point we know that it's started and then we can
Expand All @@ -1263,7 +1263,7 @@ impl<'test> TestCx<'test> {
let Output { status, stdout, stderr } = Command::new(&gdb_path)
.args(debugger_opts)
.output()
.unwrap_or_else(|_| panic!("failed to exec `{:?}`", gdb_path));
.unwrap_or_else(|e| panic!("failed to exec `{gdb_path:?}`: {e:?}"));
let cmdline = {
let mut gdb = Command::new(&format!("{}-gdb", self.config.target));
gdb.args(debugger_opts);
Expand Down Expand Up @@ -2277,7 +2277,7 @@ impl<'test> TestCx<'test> {
add_dylib_path(&mut command, iter::once(lib_path).chain(aux_path));

let mut child = disable_error_reporting(|| command.spawn())
.unwrap_or_else(|_| panic!("failed to exec `{:?}`", &command));
.unwrap_or_else(|e| panic!("failed to exec `{command:?}`: {e:?}"));
if let Some(input) = input {
child.stdin.as_mut().unwrap().write_all(input.as_bytes()).unwrap();
}
Expand Down Expand Up @@ -3838,8 +3838,8 @@ impl<'test> TestCx<'test> {
.open(coverage_file_path.as_path())
.expect("could not create or open file");

if writeln!(file, "{}", self.testpaths.file.display()).is_err() {
panic!("couldn't write to {}", coverage_file_path.display());
if let Err(e) = writeln!(file, "{}", self.testpaths.file.display()) {
panic!("couldn't write to {}: {e:?}", coverage_file_path.display());
}
}
} else if self.props.run_rustfix {
Expand Down