MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / LoadFlagsFromFile

Function LoadFlagsFromFile

tests/gtest/gtest-all.cc:7400–7416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7398
7399#if GTEST_USE_OWN_FLAGFILE_FLAG_
7400static void LoadFlagsFromFile(const std::string& path) {
7401 FILE* flagfile = posix::FOpen(path.c_str(), "r");
7402 if (!flagfile) {
7403 GTEST_LOG_(FATAL) << "Unable to open file \"" << GTEST_FLAG(flagfile)
7404 << "\"";
7405 }
7406 std::string contents(ReadEntireFile(flagfile));
7407 posix::FClose(flagfile);
7408 std::vector<std::string> lines;
7409 SplitString(contents, '\n', &lines);
7410 for (size_t i = 0; i < lines.size(); ++i) {
7411 if (lines[i].empty())
7412 continue;
7413 if (!ParseGoogleTestFlag(lines[i].c_str()))
7414 g_help_flag = true;
7415 }
7416}
7417#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
7418
7419// Parses the command line for Google Test flags, without initializing

Callers 1

Calls 6

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

Tested by

no test coverage detected