Skip to content

Check that we never panic in the test frameworkΒ #1375

@bjorn3

Description

@bjorn3

Basically when creating an Output value already check that stderr doesn't contain the word panic and that the exit code is not 101.

impl TryFrom<process::Output> for Output {
type Error = Error;
fn try_from(output: process::Output) -> std::result::Result<Self, Self::Error> {
let mut stderr = String::from_utf8(output.stderr)?;
let mut stdout = String::from_utf8(output.stdout)?;
// it's a common pitfall to forget to remove the trailing '\n' so remove it here
if stderr.ends_with('\n') {
stderr.pop();
}
if stdout.ends_with('\n') {
stdout.pop();
}
Ok(Output {
status: output.status,
stderr,
stdout,
})
}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions