diff options
author | Abseil Team <absl-team@google.com> | 2020-01-10 16:57:33 (GMT) |
---|---|---|
committer | vslashg <gfalcon@google.com> | 2020-01-16 18:55:36 (GMT) |
commit | ed16134fb31382fd41e8fe513a0e9e940d04cd31 (patch) | |
tree | c6f7d8b83fe3a9a308099067874487c46d16efe9 | |
parent | d854bd6acc47f7f6e168007d58b5f509e4981b36 (diff) | |
download | googletest-ed16134fb31382fd41e8fe513a0e9e940d04cd31.zip googletest-ed16134fb31382fd41e8fe513a0e9e940d04cd31.tar.gz googletest-ed16134fb31382fd41e8fe513a0e9e940d04cd31.tar.bz2 |
Googletest export
Change testing::TempDir() return value for Android
PiperOrigin-RevId: 289102017
-rw-r--r-- | googletest/src/gtest.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 07015cb..2df647b 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -6289,7 +6289,11 @@ std::string TempDir() { else return std::string(temp_dir) + "\\"; #elif GTEST_OS_LINUX_ANDROID - return "/sdcard/"; + const char* temp_dir = internal::posix::GetEnv("TEST_TMPDIR"); + if (temp_dir == nullptr || temp_dir[0] == '\0') + return "/data/local/tmp/"; + else + return temp_dir; #else return "/tmp/"; #endif // GTEST_OS_WINDOWS_MOBILE |