From 338bd379d0f8eca7a2eac079dd4103a864a2608f Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 13 Nov 2024 11:01:00 +0100 Subject: [PATCH 1/2] refs #12274 - test/cli/more-projects_test.py: made `test_shared_items_project` location-independent --- test/cli/more-projects_test.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/cli/more-projects_test.py b/test/cli/more-projects_test.py index 7824bb88f5c..073474d93c8 100644 --- a/test/cli/more-projects_test.py +++ b/test/cli/more-projects_test.py @@ -5,6 +5,7 @@ import sys from testutils import cppcheck, assert_cppcheck +__script_dir = os.path.dirname(os.path.abspath(__file__)) def test_project_force_U(tmpdir): # 10018 @@ -845,19 +846,17 @@ def test_compdb_D(tmpdir): assert ret == 0, stdout -def test_shared_items_project(tmpdir = ""): - # tmpdir is unused - solutionDir = os.path.join(os.getcwd(), 'shared-items-project') - solutionFile = os.path.join(solutionDir, 'Solution.sln') +def test_shared_items_project(): + solution_file = os.path.join('shared-items-project', 'Solution.sln') args = [ '--platform=win64', - '--project={}'.format(solutionFile), + '--project={}'.format(solution_file), '--project-configuration=Release|x64', '-j1' ] - exitcode, stdout, stderr = cppcheck(args) + exitcode, stdout, stderr = cppcheck(args, cwd=__script_dir) assert exitcode == 0 lines = stdout.splitlines() From 30260eb45c31827eabf9989a1c2a201fc1bbbf34 Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 13 Nov 2024 11:19:02 +0100 Subject: [PATCH 2/2] est/cli/more-projects_test.py: removed `-j1` from `test_shared_items_project` --- test/cli/more-projects_test.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/cli/more-projects_test.py b/test/cli/more-projects_test.py index 073474d93c8..e82231cfcc8 100644 --- a/test/cli/more-projects_test.py +++ b/test/cli/more-projects_test.py @@ -852,14 +852,12 @@ def test_shared_items_project(): args = [ '--platform=win64', '--project={}'.format(solution_file), - '--project-configuration=Release|x64', - '-j1' + '--project-configuration=Release|x64' ] exitcode, stdout, stderr = cppcheck(args, cwd=__script_dir) assert exitcode == 0 - lines = stdout.splitlines() # Assume no errors, and that shared items code files have been checked as well - assert any('2/2 files checked 100% done' in x for x in lines) + assert '2/2 files checked ' in stdout # only perform partial check since -j2 does not report a percentage right now assert stderr == ''