mirror of
https://github.com/google/googletest.git
synced 2024-12-27 10:11:03 +08:00
Makes death tests create temporary files in /tmp instead of the current folder.
This commit is contained in:
parent
d88da49d02
commit
dc6ee0e36d
@ -96,7 +96,10 @@ class CapturedStderr {
|
|||||||
CapturedStderr() {
|
CapturedStderr() {
|
||||||
uncaptured_fd_ = dup(STDERR_FILENO);
|
uncaptured_fd_ = dup(STDERR_FILENO);
|
||||||
|
|
||||||
char name_template[] = "captured_stderr.XXXXXX";
|
// There's no guarantee that a test has write access to the
|
||||||
|
// current directory, so we create the temporary file in the /tmp
|
||||||
|
// directory instead.
|
||||||
|
char name_template[] = "/tmp/captured_stderr.XXXXXX";
|
||||||
const int captured_fd = mkstemp(name_template);
|
const int captured_fd = mkstemp(name_template);
|
||||||
filename_ = name_template;
|
filename_ = name_template;
|
||||||
fflush(NULL);
|
fflush(NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user