|
4 | 4 | import os
|
5 | 5 | import json
|
6 | 6 | import pytest
|
| 7 | +import sys |
7 | 8 | from testutils import cppcheck
|
8 | 9 |
|
9 | 10 | __script_dir = os.path.dirname(os.path.abspath(__file__))
|
@@ -61,11 +62,19 @@ def test_unused_functions_builddir(tmpdir):
|
61 | 62 | __test_unused_functions(['-j1', '--cppcheck-build-dir={}'.format(build_dir)])
|
62 | 63 |
|
63 | 64 |
|
| 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') |
64 | 72 | @pytest.mark.xfail(strict=True)
|
65 |
| -def test_unused_functions_builddir_j(tmpdir): |
| 73 | +def test_unused_functions_builddir_j_process(tmpdir): |
66 | 74 | build_dir = os.path.join(tmpdir, 'b1')
|
67 | 75 | 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 | + |
69 | 78 |
|
70 | 79 | def __test_unused_functions_project(extra_args):
|
71 | 80 | project_file = os.path.join(__project_dir, 'unusedFunction.cppcheck')
|
@@ -111,11 +120,18 @@ def test_unused_functions_project_builddir(tmpdir):
|
111 | 120 | __test_unused_functions_project(['-j1', '--cppcheck-build-dir={}'.format(build_dir)])
|
112 | 121 |
|
113 | 122 |
|
| 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') |
114 | 130 | @pytest.mark.xfail(strict=True)
|
115 |
| -def test_unused_functions_project_builddir_j(tmpdir): |
| 131 | +def test_unused_functions_project_builddir_j_process(tmpdir): |
116 | 132 | build_dir = os.path.join(tmpdir, 'b1')
|
117 | 133 | 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']) |
119 | 135 |
|
120 | 136 |
|
121 | 137 | def __test_unused_functions_compdb(tmpdir, extra_args):
|
@@ -163,8 +179,15 @@ def test_unused_functions_compdb_builddir(tmpdir):
|
163 | 179 | __test_unused_functions_compdb(tmpdir, ['-j1', '--cppcheck-build-dir={}'.format(build_dir)])
|
164 | 180 |
|
165 | 181 |
|
| 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') |
166 | 189 | @pytest.mark.xfail(strict=True)
|
167 |
| -def test_unused_functions_compdb_buildir_j(tmpdir): |
| 190 | +def test_unused_functions_compdb_buildir_j_process(tmpdir): |
168 | 191 | build_dir = os.path.join(tmpdir, 'b1')
|
169 | 192 | 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