Skip to content

Commit b093636

Browse files
committed
test/cli: fixed tests utilizing cppcheck.cfg on Windows
1 parent 1084f8f commit b093636

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

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')
@@ -2028,6 +2032,8 @@ def test_config_invalid(tmpdir):
20282032
def test_config_override(tmpdir):
20292033
# cppcheck.cfg needs to be next to executable
20302034
exe = shutil.copy2(__lookup_cppcheck_exe(), tmpdir)
2035+
if sys.platform == 'win32':
2036+
shutil.copy2(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cppcheck-core.dll'), tmpdir)
20312037
shutil.copytree(os.path.join(os.path.dirname(__lookup_cppcheck_exe()), 'cfg'), os.path.join(tmpdir, 'cfg'))
20322038

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