Skip to content

Commit 7c9b217

Browse files
committed
test/cli: fixed tests utilizing cppcheck.cfg on Windows
1 parent b85270f commit 7c9b217

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

test/cli/other_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,6 +1966,8 @@ def test_addon_lookup_ext_notfound(tmpdir):
19661966
def test_config_lookup(tmpdir):
19671967
# cppcheck.cfg needs to be next to executable
19681968
exe = shutil.copy2(__lookup_cppcheck_exe(), tmpdir)
1969+
if sys.platform == 'win32':
1970+
shutil.copy2(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cppcheck-core.dll'), tmpdir)
19691971
shutil.copytree(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cfg'), os.path.join(tmpdir, 'cfg'))
19701972

19711973
test_file = os.path.join(tmpdir, 'test.c')
@@ -2007,6 +2009,8 @@ def test_config_lookup_notfound(tmpdir):
20072009
def test_config_invalid(tmpdir):
20082010
# cppcheck.cfg needs to be next to executable
20092011
exe = shutil.copy2(__lookup_cppcheck_exe(), tmpdir)
2012+
if sys.platform == 'win32':
2013+
shutil.copy2(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cppcheck-core.dll'), tmpdir)
20102014
shutil.copytree(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cfg'), os.path.join(tmpdir, 'cfg'))
20112015

20122016
test_file = os.path.join(tmpdir, 'test.c')
@@ -2027,6 +2031,8 @@ def test_config_invalid(tmpdir):
20272031
def test_config_override(tmpdir):
20282032
# cppcheck.cfg needs to be next to executable
20292033
exe = shutil.copy2(__lookup_cppcheck_exe(), tmpdir)
2034+
if sys.platform == 'win32':
2035+
shutil.copy2(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cppcheck-core.dll'), tmpdir)
20302036
shutil.copytree(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cfg'), os.path.join(tmpdir, 'cfg'))
20312037

20322038
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)