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

Method nooptionsWithCfg

test/testcmdlineparser.cpp:561–575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559 }
560
561 void nooptionsWithCfg() {
562 REDIRECT;
563 ScopedFile file(Path::join(Path::getPathFromFilename(Path::getCurrentExecutablePath("")), "cppcheck.cfg"),
564 "{\n"
565 "\"productName\": \"Cppcheck Premium\","
566 "\"manualUrl\": \"https://docs.notcppcheck.com/manual.pdf\""
567 "}\n");
568 const char * const argv[] = {"cppcheck"};
569 ASSERT_EQUALS_ENUM(CmdLineParser::Result::Exit, parseFromArgs(argv));
570 ASSERT_EQUALS(1, settings->settingsFiles.size());
571 ASSERT_EQUALS(file.path(), *settings->settingsFiles.cbegin());
572 const std::string log_str = logger->str();
573 ASSERT_MSG(startsWith(log_str, "Cppcheck - A tool for static C/C++ code analysis"), "header");
574 ASSERT_MSG(log_str.find("https://docs.notcppcheck.com/manual.pdf") != std::string::npos, "help url");
575 }
576
577 void nooptionsWithInvalidCfg() {
578 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