google / google/googletest

Make death tests more portable, including signals on Windows.

Open
#4,600 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
39.5k
Forks
10.9k
Avg merge
6d 13h
Merged PRs (30d)
1

Description

### Does the feature exist in the most recent commit?

No

### Why do we need this feature?

Because *I* need it, I guess, and you want to serve people like me? If you want to detect `SIGABRT` on one platform, why wouldn't you want to detect it everywhere possible?

### Describe the proposal.

Do something like I've done (as a workaround): define a suite of [portable death test macros](https://github.com/stlab/adobe-contract-checks/blob/13575d24048cb3f3c3128e89575fdac70fb0d469/test/portable_death_tests.hpp) and make them test as much as possible on whatever platform I'm running on. Detecting abort on Windows in my case involves [installing a signal handler that prints a unique string](https://github.com/stlab/adobe-contract-checks/blob/13575d24048cb3f3c3128e89575fdac70fb0d469/test/win32_abort_detection.cpp), which you could do less-intrusively upon invocation of the test, chaining to whatever was previously installed, and uninstalling it afterwards.

### Is the feature specific to an operating system, compiler, or build system version?

Sort of, depending on how you interpret the question. The point is that the feature can be used without regard to those things.

Contributor guide

Open the contributing guide

Research direction

Review the linked portable_death_tests.hpp and win32_abort_detection.cpp examples, then locate the existing death-test implementation and platform-specific tests in googletest. The work is complete when death tests can detect supported abort signals portably, including on Windows, without disrupting previously installed handlers.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.