diff options
author | Abseil Team <absl-team@google.com> | 2022-05-03 04:55:51 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-05-03 04:57:01 (GMT) |
commit | 0027cf47031822a93ef48fe8506853da0680033b (patch) | |
tree | 6c7739a9adf0f2639f1bf95b65cff0ed66b064f7 /googletest/src/gtest.cc | |
parent | 42ca3da5798750c2998dd09b751838227e1f58d3 (diff) | |
download | googletest-0027cf47031822a93ef48fe8506853da0680033b.zip googletest-0027cf47031822a93ef48fe8506853da0680033b.tar.gz googletest-0027cf47031822a93ef48fe8506853da0680033b.tar.bz2 |
Use TEST_TMPDIR on MacOS as well if available.
Currently MacOS falls back to generic /tmp, but
for all intents and purposes it should behave like
other Unixes using the TEST_TMPDIR environment variable
if available (this environment variable is set in bazel,
which sets up a unique temp directory for the test
process).
While at it, remove an incorrect #endif comment, that
looks like a leftover from some older implementation.
PiperOrigin-RevId: 446108391
Change-Id: I118eacf6e86a41d26cb81a130f7c54cccc0c5665
Diffstat (limited to 'googletest/src/gtest.cc')
-rw-r--r-- | googletest/src/gtest.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 1740e93..73312d4 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -6766,7 +6766,7 @@ std::string TempDir() { } else { return temp_dir; } -#elif GTEST_OS_LINUX +#elif GTEST_OS_LINUX || GTEST_OS_MAC const char* temp_dir = internal::posix::GetEnv("TEST_TMPDIR"); if (temp_dir == nullptr || temp_dir[0] == '\0') { return "/tmp/"; @@ -6775,7 +6775,7 @@ std::string TempDir() { } #else return "/tmp/"; -#endif // GTEST_OS_WINDOWS_MOBILE +#endif } // Class ScopedTrace |