From fb5f293ebf5a09a45d17d7f8bca503750a7c0953 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 7 Feb 2025 17:55:21 +0100 Subject: [PATCH] fixed #13627 - bail out on nested GUI projects instead of ignoring them silently --- cli/cmdlineparser.cpp | 4 ++++ test/cli/more-projects_test.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index d6c792645c1..4ce33d8a8ac 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -1168,6 +1168,10 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a // read underlying project projectFile = projectFileGui; projType = project.import(projectFileGui, &mSettings, &mSuppressions); + if (projType == ImportProject::Type::CPPCHECK_GUI) { + mLogger.printError("nested Cppcheck GUI projects are not supported."); + return Result::Fail; + } } } if (projType == ImportProject::Type::VS_SLN || projType == ImportProject::Type::VS_VCXPROJ) { diff --git a/test/cli/more-projects_test.py b/test/cli/more-projects_test.py index 6f51c477457..f61b0c42e9f 100644 --- a/test/cli/more-projects_test.py +++ b/test/cli/more-projects_test.py @@ -893,7 +893,7 @@ def test_project_file_nested(tmp_path): args = ['--project={}'.format(level1_file)] out_lines = [ - 'cppcheck: error: no C or C++ source files found.' + 'cppcheck: error: nested Cppcheck GUI projects are not supported.' ] assert_cppcheck(args, ec_exp=1, err_exp=[], out_exp=out_lines) \ No newline at end of file