Skip to content

Commit a4c3d5f

Browse files
committed
test/cli: fixed tests utilizing cppcheck.cfg on Windows
1 parent 48acb4c commit a4c3d5f

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
@@ -1726,6 +1726,8 @@ def test_cpp_probe_2(tmpdir):
17261726
def test_config_invalid(tmpdir):
17271727
# cppcheck.cfg needs to be next to executable
17281728
exe = shutil.copy2(__lookup_cppcheck_exe(), tmpdir)
1729+
if sys.platform == 'win32':
1730+
shutil.copy2(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cppcheck-core.dll'), tmpdir)
17291731
shutil.copytree(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cfg'), os.path.join(tmpdir, 'cfg'))
17301732

17311733
test_file = os.path.join(tmpdir, 'test.c')
@@ -1746,6 +1748,8 @@ def test_config_invalid(tmpdir):
17461748
def test_config_override(tmpdir):
17471749
# cppcheck.cfg needs to be next to executable
17481750
exe = shutil.copy2(__lookup_cppcheck_exe(), tmpdir)
1751+
if sys.platform == 'win32':
1752+
shutil.copy2(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cppcheck-core.dll'), tmpdir)
17491753
shutil.copytree(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cfg'), os.path.join(tmpdir, 'cfg'))
17501754

17511755
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')
@@ -35,10 +37,6 @@ def __copy_cppcheck_premium(tmpdir):
3537

3638

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

0 commit comments

Comments
 (0)