Skip to content

Commit 3a2e64d

Browse files
committed
adjusted some Python tests
1 parent 4dde94b commit 3a2e64d

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

test/cli/other_test.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2766,12 +2766,15 @@ def __test_addon_suppr(tmp_path, extra_args):
27662766
def test_addon_suppr_inline(tmp_path):
27672767
__test_addon_suppr(tmp_path, ['--inline-suppr', '-j1'])
27682768

2769+
# TODO: remove override when all issues are fixed
2770+
def test_addon_suppr_inline_j_thread(tmp_path):
2771+
__test_addon_suppr(tmp_path, ['--inline-suppr', '-j2', '--executor=thread'])
27692772

27702773
# TODO: remove override when all issues are fixed
2774+
@pytest.mark.skipif(sys.platform == 'win32', reason='ProcessExecutor not available on Windows')
27712775
@pytest.mark.xfail(strict=True) # TODO: inline suppression does not work
2772-
def test_addon_suppr_inline_j(tmp_path):
2773-
__test_addon_suppr(tmp_path, ['--inline-suppr', '-j2'])
2774-
2776+
def test_addon_suppr_inline_j_process(tmp_path):
2777+
__test_addon_suppr(tmp_path, ['--inline-suppr', '-j2', '--executor=process'])
27752778

27762779
def test_addon_suppr_cli_line(tmp_path):
27772780
__test_addon_suppr(tmp_path, ['--suppress=misra-c2012-2.3:*:3'])

test/cli/unused_function_test.py

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import json
66
import pytest
7+
import sys
78
from testutils import cppcheck
89

910
__script_dir = os.path.dirname(os.path.abspath(__file__))
@@ -61,11 +62,19 @@ def test_unused_functions_builddir(tmpdir):
6162
__test_unused_functions(['-j1', '--cppcheck-build-dir={}'.format(build_dir)])
6263

6364

65+
def test_unused_functions_builddir_j_thread(tmpdir):
66+
build_dir = os.path.join(tmpdir, 'b1')
67+
os.mkdir(build_dir)
68+
__test_unused_functions(['-j2', '--cppcheck-build-dir={}'.format(build_dir), '--executor=thread'])
69+
70+
71+
@pytest.mark.skipif(sys.platform == 'win32', reason='ProcessExecutor not available on Windows')
6472
@pytest.mark.xfail(strict=True)
65-
def test_unused_functions_builddir_j(tmpdir):
73+
def test_unused_functions_builddir_j_process(tmpdir):
6674
build_dir = os.path.join(tmpdir, 'b1')
6775
os.mkdir(build_dir)
68-
__test_unused_functions(['-j2', '--cppcheck-build-dir={}'.format(build_dir)])
76+
__test_unused_functions(['-j2', '--cppcheck-build-dir={}'.format(build_dir), '--executor=process'])
77+
6978

7079
def __test_unused_functions_project(extra_args):
7180
project_file = os.path.join(__project_dir, 'unusedFunction.cppcheck')
@@ -111,11 +120,18 @@ def test_unused_functions_project_builddir(tmpdir):
111120
__test_unused_functions_project(['-j1', '--cppcheck-build-dir={}'.format(build_dir)])
112121

113122

123+
def test_unused_functions_project_builddir_j_thread(tmpdir):
124+
build_dir = os.path.join(tmpdir, 'b1')
125+
os.mkdir(build_dir)
126+
__test_unused_functions_project(['-j2', '--cppcheck-build-dir={}'.format(build_dir), '--executor=thread'])
127+
128+
129+
@pytest.mark.skipif(sys.platform == 'win32', reason='ProcessExecutor not available on Windows')
114130
@pytest.mark.xfail(strict=True)
115-
def test_unused_functions_project_builddir_j(tmpdir):
131+
def test_unused_functions_project_builddir_j_process(tmpdir):
116132
build_dir = os.path.join(tmpdir, 'b1')
117133
os.mkdir(build_dir)
118-
__test_unused_functions_project(['-j2', '--cppcheck-build-dir={}'.format(build_dir)])
134+
__test_unused_functions_project(['-j2', '--cppcheck-build-dir={}'.format(build_dir), '--executor=process'])
119135

120136

121137
def __test_unused_functions_compdb(tmpdir, extra_args):
@@ -163,8 +179,15 @@ def test_unused_functions_compdb_builddir(tmpdir):
163179
__test_unused_functions_compdb(tmpdir, ['-j1', '--cppcheck-build-dir={}'.format(build_dir)])
164180

165181

182+
def test_unused_functions_compdb_buildir_j_thread(tmpdir):
183+
build_dir = os.path.join(tmpdir, 'b1')
184+
os.mkdir(build_dir)
185+
__test_unused_functions_compdb(tmpdir, ['-j2', '--cppcheck-build-dir={}'.format(build_dir), '--executor=thread'])
186+
187+
188+
@pytest.mark.skipif(sys.platform == 'win32', reason='ProcessExecutor not available on Windows')
166189
@pytest.mark.xfail(strict=True)
167-
def test_unused_functions_compdb_buildir_j(tmpdir):
190+
def test_unused_functions_compdb_buildir_j_process(tmpdir):
168191
build_dir = os.path.join(tmpdir, 'b1')
169192
os.mkdir(build_dir)
170-
__test_unused_functions_compdb(tmpdir, ['-j2', '--cppcheck-build-dir={}'.format(build_dir)])
193+
__test_unused_functions_compdb(tmpdir, ['-j2', '--cppcheck-build-dir={}'.format(build_dir), '--executor=process'])

0 commit comments

Comments
 (0)