Skip to content

Commit d7eff7d

Browse files
committed
test/cli: fixed tests utilizing cppcheck.cfg on Windows
1 parent 362cb54 commit d7eff7d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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')
@@ -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)