Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/google/googletest.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2022-05-03 07:55:51 +0300
committerCopybara-Service <copybara-worker@google.com>2022-05-03 07:57:01 +0300
commit0027cf47031822a93ef48fe8506853da0680033b (patch)
tree6c7739a9adf0f2639f1bf95b65cff0ed66b064f7
parent42ca3da5798750c2998dd09b751838227e1f58d3 (diff)
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
-rw-r--r--googletest/src/gtest.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 1740e931..73312d4c 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