@@ -246,9 +246,16 @@ def test_execute_addon_failure_json_notexist(tmpdir):
246246@pytest .mark .skipif (sys .platform != "win32" , reason = "Windows specific issue" )
247247def test_execute_addon_path_with_spaces (tmpdir ):
248248 addon_json = os .path .join (tmpdir , 'addon.json' )
249- addon_executable = os .path .join (tmpdir , 'A Folder' , 'addon.exe' )
249+ addon_dir = os .path .join (tmpdir , 'A Folder' )
250+ addon_script = os .path .join (addon_dir , 'addon.bat' )
251+
250252 with open (addon_json , 'wt' ) as f :
251- f .write (json .dumps ({'executable' : addon_executable }))
253+ f .write (json .dumps ({'executable' : addon_script }))
254+
255+ os .makedirs (addon_dir , exist_ok = True )
256+
257+ with open (addon_script , 'wt' ) as f :
258+ f .write ('@echo {"file":"1.c","linenr":1,"column":1,"severity":"error","message":"hello world","errorId":"hello","addon":"test"}' )
252259
253260 test_file = os .path .join (tmpdir , 'test.cpp' )
254261 with open (test_file , 'wt' ) as f :
@@ -257,14 +264,12 @@ def test_execute_addon_path_with_spaces(tmpdir):
257264 args = [
258265 '--addon={}' .format (addon_json ),
259266 test_file ,
260- '--verbose' ,
261- '--debug'
262267 ]
263268
264269 _ , _ , stderr = cppcheck (args )
265270
266271 # Make sure the full command is used
267- assert 'The system cannot find the path specified. [internalError] ' in stderr
272+ assert '1.c:1:1: error: hello world [test-hello] \n ' in stderr
268273
269274
270275def test_execute_addon_failure_json_ctu_notexist (tmpdir ):
0 commit comments