Skip to content

Commit 449f61e

Browse files
committed
CppCheckExecutor: report all addon loading failures at once
1 parent ee405e5 commit 449f61e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cli/cppcheckexecutor.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,16 +363,18 @@ bool CppCheckExecutor::loadLibraries(Settings& settings)
363363

364364
bool CppCheckExecutor::loadAddons(Settings& settings)
365365
{
366+
bool result = true;
366367
for (const std::string &addon: settings.addons) {
367368
AddonInfo addonInfo;
368369
const std::string failedToGetAddonInfo = addonInfo.getAddonInfo(addon, settings.exename);
369370
if (!failedToGetAddonInfo.empty()) {
370371
std::cout << failedToGetAddonInfo << std::endl;
371-
return false;
372+
result = false;
373+
continue;
372374
}
373375
settings.addonInfos.emplace_back(std::move(addonInfo));
374376
}
375-
return true;
377+
return result;
376378
}
377379

378380
#ifdef _WIN32

test/cli/test-other.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ def test_progress_j(tmpdir):
144144

145145

146146
def test_invalid_addon(tmpdir):
147-
args = ['--addon=misra2', 'file.c']
147+
args = ['--addon=misra3', '--addon=misra', '--addon=misra2', 'file.c']
148148

149149
exitcode, stdout, stderr = cppcheck(args)
150150
assert exitcode == 1
151-
assert stdout == '(information) Did not find addon misra2.py\n'
151+
assert (stdout == 'Did not find addon misra2.py\n'
152+
'Did not find addon misra3.py\n')
152153
assert stderr == ""

0 commit comments

Comments
 (0)