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

Fix some Catch2 tests not returning exit code. #2943

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

rectified95
Copy link
Collaborator

@rectified95 rectified95 commented Oct 3, 2023

Description

#2707 was recently fixed by amending the error parsing expression.

This is a follow-up fix that will make use of us checking for $LASTEXITCODE too.
xdp_test and connect_redirect_test were swallowing the return code and implicitly returning 0 (per the C standard, p.13 https://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf)
so the exit code portion of our error detecting was being ignored.

Here's an example from Catch2 docs:
https://github.com/catchorg/Catch2/blob/devel/docs/own-main.md#amending-the-catch2-config

And we're doing it right in socket_tests.cpp:
https://github.com/microsoft/ebpf-for-windows/blob/main/tests/socket/socket_tests.cpp#L471

Testing

Locally running the tests without eBPF installed fails as expected and sets the $LASTEXITCODE to the number of failed tests.
image

@dthaler dthaler added this pull request to the merge queue Oct 4, 2023
@dthaler dthaler added bug Something isn't working tests labels Oct 4, 2023
Merged via the queue into microsoft:main with commit 9f66160 Oct 4, 2023
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants