Skip to content

[unittest] Use TempDir() in gtest death-test stream capture on Linux#194142

Merged
joker-eph merged 1 commit into
llvm:mainfrom
joker-eph:fix_gtest_tmp
Apr 28, 2026
Merged

[unittest] Use TempDir() in gtest death-test stream capture on Linux#194142
joker-eph merged 1 commit into
llvm:mainfrom
joker-eph:fix_gtest_tmp

Conversation

@joker-eph
Copy link
Copy Markdown
Contributor

gtest's CapturedStream on Linux hardcoded /tmp/ for its temp file without consulting the environment, causing failures in sandboxed environments where /tmp is read-only. Use TempDir() instead, which checks TEST_TMPDIR then TMPDIR and falls back to /tmp/, matching the behavior already present on Android and macOS/iOS.

See also upstream PR: google/googletest#4962

Assisted-by: Claude Code

gtest's CapturedStream on Linux hardcoded /tmp/ for its temp file
without consulting the environment, causing failures in sandboxed
environments where /tmp is read-only. Use TempDir() instead, which
checks TEST_TMPDIR then TMPDIR and falls back to /tmp/, matching the
behavior already present on Android and macOS/iOS.

Assisted-by: Claude Code
@joker-eph joker-eph requested a review from zeroomega April 25, 2026 13:20
@joker-eph joker-eph merged commit 91b6c73 into llvm:main Apr 28, 2026
11 checks passed
@joker-eph joker-eph deleted the fix_gtest_tmp branch April 28, 2026 19:36
kirthana14m pushed a commit to ROCm/llvm-project that referenced this pull request Apr 30, 2026
…lvm#194142)

gtest's CapturedStream on Linux hardcoded /tmp/ for its temp file
without consulting the environment, causing failures in sandboxed
environments where /tmp is read-only. Use TempDir() instead, which
checks TEST_TMPDIR then TMPDIR and falls back to /tmp/, matching the
behavior already present on Android and macOS/iOS.

See also upstream PR: google/googletest#4962

Assisted-by: Claude Code
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.

2 participants