From d0f24fe015361bcb582980077b6572c2b62893ea Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 7 Feb 2025 17:53:32 +0100 Subject: [PATCH] test/cli/more-projects_test.py: added test show --- test/cli/more-projects_test.py | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/cli/more-projects_test.py b/test/cli/more-projects_test.py index e82231cfcc8..6f51c477457 100644 --- a/test/cli/more-projects_test.py +++ b/test/cli/more-projects_test.py @@ -861,3 +861,39 @@ def test_shared_items_project(): # Assume no errors, and that shared items code files have been checked as well assert '2/2 files checked ' in stdout # only perform partial check since -j2 does not report a percentage right now assert stderr == '' + + +def test_project_file_nested(tmp_path): + test_file = tmp_path / 'test.c' + with open(test_file, 'wt'): + pass + + level3_file = tmp_path / 'level3.cppcheck' + with open(level3_file, 'wt') as f: + f.write( +""" + + + +""".format(test_file)) + + level2_file = tmp_path / 'level2.cppcheck' + with open(level2_file, 'wt') as f: + f.write( +""" + level3.cppcheck +""") + + level1_file = tmp_path / 'level1.cppcheck' + with open(level1_file, 'wt') as f: + f.write( +""" + level2.cppcheck +""") + + args = ['--project={}'.format(level1_file)] + out_lines = [ + 'cppcheck: error: no C or C++ source files found.' + ] + + assert_cppcheck(args, ec_exp=1, err_exp=[], out_exp=out_lines) \ No newline at end of file