Skip to content

fix(death-tests): escape ':' and '-' in threadsafe child filters - #5108

Open
rwinkelman wants to merge 2 commits into
google:mainfrom
rwinkelman:fix/death-test-filter-colon-5105
Open

rwinkelman wants to merge 2 commits into
google:mainfrom
rwinkelman:fix/death-test-filter-colon-5105

Conversation

@rwinkelman

Copy link
Copy Markdown

Summary

Threadsafe (and Windows/Fuchsia) death tests re-exec the binary with --gtest_filter=<suite>.<name>. Filter syntax treats : as a pattern separator and - as the start of a negative filter, so typed-test names like std::string never match. The child exits 0 without running the statement; the parent treats a missing status byte as DIED, so non-dying death tests pass.

  • Escape \\, :, and - when building the death-test filter flag
  • Parse --gtest_filter with escape-aware splits on : and -

Fixes #5105

Test plan

  • Typed death test with GetName returning "std::string" fails EXPECT_EXIT that does not exit (statement runs)
  • Same suite with "int" still passes/fails as before
  • Existing death-test suite

Typed-test names like std::string put ':' into --gtest_filter, which
splits patterns so the child matches nothing and death tests falsely
pass. Escape filter metacharacters and parse filters with unescaped
delimiters only.

Fixes google#5105
@google-cla

google-cla Bot commented Sep 28, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

This branch has not been deployed

No deployments
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.

[Bug]: Threadsafe death tests pass without running when the test name contains ':' (e.g. typed test named "std::string")

1 participant