Skip to content

Commit 10b5e2c

Browse files
committed
add test
1 parent 4780cd2 commit 10b5e2c

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

test/cli/other_test.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,30 @@ def test_execute_addon_failure_json_notexist(tmpdir):
243243
assert stderr == "{}:0:0: error: Bailing out from analysis: Checking file failed: Failed to execute addon 'addon.json' - exitcode is {} [internalError]\n\n^\n".format(test_file, ec)
244244

245245

246+
@pytest.mark.skipif(sys.platform != "win32", reason="Windows specific issue")
247+
def test_execute_addon_path_with_spaces(tmpdir):
248+
addon_json = os.path.join(tmpdir, 'addon.json')
249+
addon_executable = os.path.join(tmpdir, 'A Folder', 'addon.exe')
250+
with open(addon_json, 'wt') as f:
251+
f.write(json.dumps({'executable': addon_executable }))
252+
253+
test_file = os.path.join(tmpdir, 'test.cpp')
254+
with open(test_file, 'wt') as f:
255+
pass
256+
257+
args = [
258+
'--addon={}'.format(addon_json),
259+
test_file,
260+
'--verbose',
261+
'--debug'
262+
]
263+
264+
_, _, stderr = cppcheck(args)
265+
266+
# Make sure the full command is used
267+
assert 'The system cannot find the path specified. [internalError]' in stderr
268+
269+
246270
def test_execute_addon_failure_json_ctu_notexist(tmpdir):
247271
# specify non-existent python executable so execution of addon fails
248272
addon_json = os.path.join(tmpdir, 'addon.json')

0 commit comments

Comments
 (0)