GTest on Android needs a custom tmpdir path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163501 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evgeniy Stepanov 2012-09-10 10:32:29 +00:00
parent 8cc1494905
commit 4fbaa509eb

View File

@ -505,6 +505,10 @@ class CapturedStream {
GTEST_CHECK_(captured_fd != -1) << "Unable to open temporary file "
<< temp_file_path;
filename_ = temp_file_path;
#elif GTEST_OS_LINUX_ANDROID
char name_template[] = "/sdcard/captured_stderr.XXXXXX";
const int captured_fd = mkstemp(name_template);
filename_ = name_template;
# else
// There's no guarantee that a test has write access to the
// current directory, so we create the temporary file in the /tmp