Skip to content

Commit 0545e65

Browse files
authored
fix #11984: cppcheck --errorlist : regression, no missingInclude (#6943)
1 parent 27cca72 commit 0545e65

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Diff for: lib/cppcheck.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -1707,11 +1707,7 @@ void CppCheck::reportProgress(const std::string &filename, const char stage[], c
17071707
void CppCheck::getErrorMessages(ErrorLogger &errorlogger)
17081708
{
17091709
Settings s;
1710-
s.severity.enable(Severity::warning);
1711-
s.severity.enable(Severity::style);
1712-
s.severity.enable(Severity::portability);
1713-
s.severity.enable(Severity::performance);
1714-
s.severity.enable(Severity::information);
1710+
s.addEnabled("all");
17151711

17161712
CppCheck cppcheck(errorlogger, true, nullptr);
17171713
cppcheck.purgedConfigurationMessage(emptyString,emptyString);

Diff for: test/testcppcheck.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,22 @@ class TestCppcheck : public TestFixture {
8282
// Check for error ids from this class.
8383
bool foundPurgedConfiguration = false;
8484
bool foundTooManyConfigs = false;
85+
bool foundMissingInclude = false; // #11984
86+
bool foundMissingIncludeSystem = false; // #11984
8587
for (const std::string & it : errorLogger.ids) {
8688
if (it == "purgedConfiguration")
8789
foundPurgedConfiguration = true;
8890
else if (it == "toomanyconfigs")
8991
foundTooManyConfigs = true;
92+
else if (it == "missingInclude")
93+
foundMissingInclude = true;
94+
else if (it == "missingIncludeSystem")
95+
foundMissingIncludeSystem = true;
9096
}
9197
ASSERT(foundPurgedConfiguration);
9298
ASSERT(foundTooManyConfigs);
99+
ASSERT(foundMissingInclude);
100+
ASSERT(foundMissingIncludeSystem);
93101
}
94102

95103
void checkWithFile() const

0 commit comments

Comments
 (0)