| 5250 | |
| 5251 | #if GTEST_USE_OWN_FLAGFILE_FLAG_ |
| 5252 | void LoadFlagsFromFile(const std::string& path) { |
| 5253 | FILE* flagfile = posix::FOpen(path.c_str(), "r"); |
| 5254 | if (!flagfile) { |
| 5255 | fprintf(stderr, |
| 5256 | "Unable to open file \"%s\"\n", |
| 5257 | GTEST_FLAG(flagfile).c_str()); |
| 5258 | fflush(stderr); |
| 5259 | exit(EXIT_FAILURE); |
| 5260 | } |
| 5261 | std::string contents(ReadEntireFile(flagfile)); |
| 5262 | posix::FClose(flagfile); |
| 5263 | std::vector<std::string> lines; |
| 5264 | SplitString(contents, '\n', &lines); |
| 5265 | for (size_t i = 0; i < lines.size(); ++i) { |
| 5266 | if (lines[i].empty()) |
| 5267 | continue; |
| 5268 | if (!ParseGoogleTestFlag(lines[i].c_str())) |
| 5269 | g_help_flag = true; |
| 5270 | } |
| 5271 | } |
| 5272 | #endif // GTEST_USE_OWN_FLAGFILE_FLAG_ |
| 5273 | |
| 5274 | // Parses the command line for Google Test flags, without initializing |
no test coverage detected