MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / versionWithCfg

Method versionWithCfg

test/testcmdlineparser.cpp:653–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

651 }
652
653 void versionWithCfg() {
654 REDIRECT;
655 ScopedFile file(Path::join(Path::getPathFromFilename(Path::getCurrentExecutablePath("")), "cppcheck.cfg"),
656 "{\n"
657 "\"productName\": \"The Product\""
658 "}\n");
659 const char * const argv[] = {"cppcheck", "--version"};
660 ASSERT_EQUALS_ENUM(CmdLineParser::Result::Exit, parseFromArgs(argv));
661 ASSERT_EQUALS(1, settings->settingsFiles.size());
662 ASSERT_EQUALS(file.path(), *settings->settingsFiles.cbegin());
663 ASSERT_EQUALS("The Product\n", logger->str()); // TODO: include version?
664 }
665
666 // TODO: test --version with extraVersion
667

Callers

nothing calls this directly

Calls 3

joinFunction · 0.85
sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected