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

Ensure tests fail on stderr and pipe errors #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Syeberman
Copy link

Currently, the munit process exits with a success code, even if there is an error creating the buffer for stderr or an error creating the pipe to the forked process. This PR ensures that report.errored is incremented on both those errors, ensuring the process exits with an error code.

Note that the appropriate report counter is currently incremented everywhere else the test result is updated:

munit/munit.c

Lines 1205 to 1226 in fbbdf14

if (MUNIT_LIKELY(result == MUNIT_OK)) {
report->successful++;
#if defined(MUNIT_ENABLE_TIMING)
report->wall_clock += munit_clock_get_elapsed(&wall_clock_begin, &wall_clock_end);
report->cpu_clock += munit_clock_get_elapsed(&cpu_clock_begin, &cpu_clock_end);
#endif
} else {
switch ((int) result) {
case MUNIT_SKIP:
report->skipped++;
break;
case MUNIT_FAIL:
report->failed++;
break;
case MUNIT_ERROR:
report->errored++;
break;
default:
break;
}
break;
}

munit/munit.c

Lines 1385 to 1386 in fbbdf14

report.errored++;
result = MUNIT_ERROR;

munit/munit.c

Lines 1431 to 1432 in fbbdf14

result = MUNIT_FAIL;
report.failed++;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant