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