Skip to content

Commit 648d1c8

Browse files
authored
refs #12274 - test/cli/more-projects_test.py: made test_shared_items_project location-independent / removed -j1 (danmar#7002)
1 parent 550243a commit 648d1c8

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

test/cli/more-projects_test.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sys
66
from testutils import cppcheck, assert_cppcheck
77

8+
__script_dir = os.path.dirname(os.path.abspath(__file__))
89

910
def test_project_force_U(tmpdir):
1011
# 10018
@@ -845,22 +846,18 @@ def test_compdb_D(tmpdir):
845846
assert ret == 0, stdout
846847

847848

848-
def test_shared_items_project(tmpdir = ""):
849-
# tmpdir is unused
850-
solutionDir = os.path.join(os.getcwd(), 'shared-items-project')
851-
solutionFile = os.path.join(solutionDir, 'Solution.sln')
849+
def test_shared_items_project():
850+
solution_file = os.path.join('shared-items-project', 'Solution.sln')
852851

853852
args = [
854853
'--platform=win64',
855-
'--project={}'.format(solutionFile),
856-
'--project-configuration=Release|x64',
857-
'-j1'
854+
'--project={}'.format(solution_file),
855+
'--project-configuration=Release|x64'
858856
]
859857

860-
exitcode, stdout, stderr = cppcheck(args)
858+
exitcode, stdout, stderr = cppcheck(args, cwd=__script_dir)
861859
assert exitcode == 0
862-
lines = stdout.splitlines()
863860

864861
# Assume no errors, and that shared items code files have been checked as well
865-
assert any('2/2 files checked 100% done' in x for x in lines)
862+
assert '2/2 files checked ' in stdout # only perform partial check since -j2 does not report a percentage right now
866863
assert stderr == ''

0 commit comments

Comments
 (0)