From ed16134fb31382fd41e8fe513a0e9e940d04cd31 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Fri, 10 Jan 2020 11:57:33 -0500 Subject: [PATCH] Googletest export Change testing::TempDir() return value for Android PiperOrigin-RevId: 289102017 --- googletest/src/gtest.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 07015cba..2df647ba 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