googletest icon indicating copy to clipboard operation
googletest copied to clipboard

[FR]: Add variant of `testing::TempDir()` that returns `std::filesystem::path`

Open jiawen opened this issue 3 months ago • 0 comments

Does the feature exist in the most recent commit?

It No

Why do we need this feature?

Now that C++17 is the minimum language version, std::filesystem::path is part of the standard library. It would be ergonomic if we added something like testing::TempPath() to complement testing::TempDir(), returning std::filesystem::path instead of std::string. std::filesystem::path provides some a little bit of abstraction and has some ergonomics, e.g., operator / to joining paths.

Describe the proposal.

Included in the "why" above.

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

No.

jiawen avatar Jul 23 '25 23:07 jiawen