Skip to content

Commit 34f8763

Browse files
committed
fix test/cl
1 parent de84848 commit 34f8763

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

test/cli/helloworld_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ def test_addon_with_gui_project(tmp_path):
123123
ret, stdout, stderr = cppcheck(args, cwd=tmp_path)
124124
filename = os.path.join('helloworld', 'main.c')
125125
assert ret == 0, stdout
126-
assert stdout == 'Checking %s ...\n' % filename
126+
assert stdout.strip().split('\n') == [
127+
'Checking %s ...' % filename,
128+
'Checking %s: SOME_CONFIG...' % filename
129+
]
127130
assert stderr == ('[%s:5]: (error) Division by zero.\n'
128131
'[%s:4]: (style) misra violation (use --rule-texts=<file> to get proper output)\n' % (filename, filename))
129132

test/cli/other_test.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3952,8 +3952,8 @@ def test_simplecpp_syntax_error(tmp_path):
39523952

39533953
@pytest.mark.parametrize('max_configs,number_of_configs,check_config,expected_warn', [
39543954
# max configs = default, max configs < number of configs => warn
3955-
(12, 20, False, True),
3956-
(12, 20, True, True),
3955+
(None, 20, False, True),
3956+
(None, 20, True, True),
39573957
39583958
# max configs != default, max configs < number of configs => warn if --check-config
39593959
(6, 20, False, False),
@@ -3971,7 +3971,12 @@ def test_max_configs(tmp_path, max_configs, number_of_configs, check_config, exp
39713971
f.write(f'#{dir} defined(X{i})\nx = {i};\n')
39723972
f.write('#endif\n')
39733973

3974-
args = [f'--max-configs={max_configs}', '--enable=information', '--template=simple', str(test_file)]
3974+
args = ['--enable=information', '--template=simple', str(test_file)]
3975+
3976+
if max_configs is None:
3977+
max_configs = 12 # default value
3978+
else:
3979+
args = [f'--max-configs={max_configs}'] + args
39753980

39763981
if check_config:
39773982
args = ['--check-config'] + args

0 commit comments

Comments
 (0)