Skip to content

Commit d342511

Browse files
committed
test/cli: fixed tests utilizing cppcheck.cfg on Windows [skip ci]
1 parent 9f7a6bb commit d342511

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

test/cli/other_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,6 +1705,8 @@ def test_cpp_probe_2(tmpdir):
17051705
def test_config_invalid(tmpdir):
17061706
# cppcheck.cfg needs to be next to executable
17071707
exe = shutil.copy2(__lookup_cppcheck_exe(), tmpdir)
1708+
if sys.platform == 'win32':
1709+
shutil.copy2(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cppcheck-core.dll'), tmpdir)
17081710
shutil.copytree(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cfg'), os.path.join(tmpdir, 'cfg'))
17091711

17101712
test_file = os.path.join(tmpdir, 'test.c')
@@ -1725,6 +1727,8 @@ def test_config_invalid(tmpdir):
17251727
def test_config_override(tmpdir):
17261728
# cppcheck.cfg needs to be next to executable
17271729
exe = shutil.copy2(__lookup_cppcheck_exe(), tmpdir)
1730+
if sys.platform == 'win32':
1731+
shutil.copy2(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cppcheck-core.dll'), tmpdir)
17281732
shutil.copytree(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cfg'), os.path.join(tmpdir, 'cfg'))
17291733

17301734
test_file = os.path.join(tmpdir, 'test.c')

test/cli/premium_test.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
def __copy_cppcheck_premium(tmpdir):
1616
exe = shutil.copy2(__lookup_cppcheck_exe(), tmpdir)
17+
if sys.platform == 'win32':
18+
shutil.copy2(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cppcheck-core.dll'), tmpdir)
1719

1820
# add minimum cfg/std.cfg
1921
test_cfg_folder = tmpdir.mkdir('cfg')
@@ -34,10 +36,6 @@ def __copy_cppcheck_premium(tmpdir):
3436

3537

3638
def test_misra_c_builtin_style_checks(tmpdir):
37-
# FIXME this test does not work in ci-windows.yml (release build)
38-
if sys.platform == 'win32':
39-
return
40-
4139
test_file = os.path.join(tmpdir, 'test.cpp')
4240
with open(test_file, 'wt') as f:
4341
f.write('void foo() { int x; y = 0; }')

0 commit comments

Comments
 (0)