Googletest export

Change testing::TempDir() return value for Android

PiperOrigin-RevId: 289102017
This commit is contained in:
Abseil Team 2020-01-10 11:57:33 -05:00 committed by vslashg
parent d854bd6acc
commit ed16134fb3

View File

@ -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