You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gtest-spi.h allows checking for non-fatal failures with EXPECT_NONFATAL_FAILURE() and matching the failure message.
Today, it is even possible to match against SCOPE_TRACE() traces, but it's a bit awkward, since the trace usually looks like this:
Google Test trace:
../../path/to/file.cc:104: 0
../../path/to/file.cc:95: some text
...
Since line numbers are included in the trace (which is useful when debugging tests), if the EXPECT_NONFATAL_FAILURE()substr includes the trace, it will have to include the filenames and line numbers too, but these can change over time. It would be nice to somehow just match against the values without the file names and line numbers (this would be possible if substr could be regular expression, or if it was possible to programmatically retrieve the trace values).
Describe the proposal.
Either
Add a variant macro that accepts a regular expression instead of a pure string match, or
Does the feature exist in the most recent commit?
Nope:
googletest/googletest/include/gtest/gtest-spi.h
Line 1 in ff233bd
Why do we need this feature?
gtest-spi.h allows checking for non-fatal failures with
EXPECT_NONFATAL_FAILURE()
and matching the failure message.Today, it is even possible to match against
SCOPE_TRACE()
traces, but it's a bit awkward, since the trace usually looks like this:Since line numbers are included in the trace (which is useful when debugging tests), if the
EXPECT_NONFATAL_FAILURE()
substr
includes the trace, it will have to include the filenames and line numbers too, but these can change over time. It would be nice to somehow just match against the values without the file names and line numbers (this would be possible ifsubstr
could be regular expression, or if it was possible to programmatically retrieve the trace values).Describe the proposal.
Either
Add a variant macro that accepts a regular expression instead of a pure string match, or
Add a method (something like https://en.cppreference.com/w/cpp/utility/tuple/get perhaps) that allows retrieving elements of the scoped trace.
Is the feature specific to an operating system, compiler, or build system version?
No
The text was updated successfully, but these errors were encountered: