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

Convert libc::SIGABRT to i32 #232

Open
wants to merge 1 commit into
base: esp-1.80.0.0
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion library/test/src/test_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ pub fn get_result_from_exit_code(
time_opts: &Option<time::TestTimeOptions>,
exec_time: &Option<time::TestExecTime>,
) -> TestResult {
let _sigabrt = libc::SIGABRT as i32;
let result = match status.code() {
Some(TR_OK) => TestResult::TrOk,
#[cfg(windows)]
Some(STATUS_ABORTED) => TestResult::TrFailed,
#[cfg(unix)]
None => match status.signal() {
Some(libc::SIGABRT) => TestResult::TrFailed,
Some(_sigabrt) => TestResult::TrFailed,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't do what you want. It's a pattern, so it defines a new variable named _sigabrt. https://doc.rust-lang.org/beta/book/ch18-03-pattern-syntax.html

Some(signal) => {
TestResult::TrFailedMsg(format!("child process exited with signal {signal}"))
}
Expand Down
Loading