Fix backtrace test on some linux versions#5142
Merged
SirTyson merged 1 commit intostellar:masterfrom Feb 17, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a brittle backtrace test that was failing on some Linux versions due to platform-specific formatting differences in backtrace output. The test was searching for a very specific string Catch::TestCase::invoke which doesn't always appear in backtraces depending on the compiler and system version. The fix replaces this with a more robust check for C_A_T_C_H, which is part of the test function name that Catch2 automatically generates for all test cases.
Changes:
- Replace brittle backtrace string matching with a more platform-independent check
- Add defensive empty check for backtrace output
sisuresh
approved these changes
Feb 17, 2026
dmkozh
approved these changes
Feb 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes "backtraces work" tests.
It looks like this test is too brittle. On my laptop, I get correct backtraces that are formatted like this:
While the backtrace is working, the test fails, since we look for a very specific string
Catch::TestCase::invoke, which may not exist depending on what format you get based on your version matrix. It looks like Catch automatically generates test functions with the nameC_A_T_C_H_T_E_S_T, so this string should appear no matter what formatting we get on the backtrace.Checklist
clang-formatv8.0.0 (viamake formator the Visual Studio extension)