MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / LoadFlagsFromFile

Function LoadFlagsFromFile

cpp/test/src/gtest.cc:5252–5271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5250
5251#if GTEST_USE_OWN_FLAGFILE_FLAG_
5252void 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

Callers 1

Calls 8

FOpenFunction · 0.85
ReadEntireFileFunction · 0.85
FCloseFunction · 0.85
SplitStringFunction · 0.85
ParseGoogleTestFlagFunction · 0.85
c_strMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected