MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / LoadFlagsFromFile

Function LoadFlagsFromFile

tests/gtest/src/gtest.cc:6531–6547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6529
6530#if GTEST_USE_OWN_FLAGFILE_FLAG_
6531static void LoadFlagsFromFile(const std::string& path) {
6532 FILE* flagfile = posix::FOpen(path.c_str(), "r");
6533 if (!flagfile) {
6534 GTEST_LOG_(FATAL) << "Unable to open file \"" << GTEST_FLAG(flagfile)
6535 << "\"";
6536 }
6537 std::string contents(ReadEntireFile(flagfile));
6538 posix::FClose(flagfile);
6539 std::vector<std::string> lines;
6540 SplitString(contents, '\n', &lines);
6541 for (size_t i = 0; i < lines.size(); ++i) {
6542 if (lines[i].empty())
6543 continue;
6544 if (!ParseGoogleTestFlag(lines[i].c_str()))
6545 g_help_flag = true;
6546 }
6547}
6548#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
6549
6550// Parses the command line for Google Test flags, without initializing

Callers 1

Calls 8

ReadEntireFileFunction · 0.70
SplitStringFunction · 0.70
ParseGoogleTestFlagFunction · 0.70
FOpenFunction · 0.50
FCloseFunction · 0.50
c_strMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected