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

Method helpshortWithCfg

test/testcmdlineparser.cpp:600–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

598 }
599
600 void helpshortWithCfg() {
601 REDIRECT;
602 ScopedFile file(Path::join(Path::getPathFromFilename(Path::getCurrentExecutablePath("")), "cppcheck.cfg"),
603 "{\n"
604 "\"productName\": \"Cppcheck Premium\","
605 "\"manualUrl\": \"https://docs.notcppcheck.com/manual.pdf\""
606 "}\n");
607 const char * const argv[] = {"cppcheck", "-h"};
608 ASSERT_EQUALS_ENUM(CmdLineParser::Result::Exit, parseFromArgs(argv));
609 ASSERT_EQUALS(1, settings->settingsFiles.size());
610 ASSERT_EQUALS(file.path(), *settings->settingsFiles.cbegin());
611 const std::string log_str = logger->str();
612 ASSERT_MSG(startsWith(log_str, "Cppcheck - A tool for static C/C++ code analysis"), "header");
613 ASSERT_MSG(log_str.find("https://docs.notcppcheck.com/manual.pdf") != std::string::npos, "help url");
614 }
615
616 void helplong() {
617 REDIRECT;

Callers

nothing calls this directly

Calls 5

joinFunction · 0.85
startsWithFunction · 0.50
sizeMethod · 0.45
strMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected