Allow CreateDirectoriesRecursively() to fail on report
Only warn on failure to create path to report file. When running in a semihosted ARM environment. There is no stat support nor mkdir, so existens checks for directories will always fail, however file open may still work.
This commit is contained in:
parent
04cf298916
commit
f1c62fdfec
@ -211,9 +211,10 @@ static FILE* OpenFileForWriting(const std::string& output_file) {
|
|||||||
FilePath output_file_path(output_file);
|
FilePath output_file_path(output_file);
|
||||||
FilePath output_dir(output_file_path.RemoveFileName());
|
FilePath output_dir(output_file_path.RemoveFileName());
|
||||||
|
|
||||||
if (output_dir.CreateDirectoriesRecursively()) {
|
if (!output_dir.CreateDirectoriesRecursively()) {
|
||||||
fileout = posix::FOpen(output_file.c_str(), "w");
|
GTEST_LOG_(WARNING) << "Unable to create path to file \"" << output_file << "\"";
|
||||||
}
|
}
|
||||||
|
fileout = posix::FOpen(output_file.c_str(), "w");
|
||||||
if (fileout == nullptr) {
|
if (fileout == nullptr) {
|
||||||
GTEST_LOG_(FATAL) << "Unable to open file \"" << output_file << "\"";
|
GTEST_LOG_(FATAL) << "Unable to open file \"" << output_file << "\"";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user