@@ -386,19 +386,23 @@ def test_platform_lookup_path(tmpdir):
386386 with open (test_file , 'wt' ):
387387 pass
388388
389- c = 'cppcheck.exe' if sys . platform == 'win32' else 'cppcheck'
389+ cppcheck = 'cppcheck' # No path
390390 path = os .path .dirname (__lookup_cppcheck_exe ())
391391 env = os .environ .copy ()
392392 env ['PATH' ] = path
393- exitcode , stdout , stderr , _ = cppcheck_ex (args = ['--debug-lookup=platform' , '--platform=avr8.xml' , test_file ], cppcheck_exe = c , cwd = str (tmpdir ), env = env )
393+ exitcode , stdout , stderr , _ = cppcheck_ex (args = ['--debug-lookup=platform' , '--platform=avr8.xml' , test_file ], cppcheck_exe = cppcheck , cwd = str (tmpdir ), env = env )
394394 assert exitcode == 0 , stdout if stdout else stderr
395- lines = stdout .replace ('\\ ' , '/' ).splitlines ()
395+ lookup1 = os .path .join (tmpdir , 'avr8.xml' )
396+ lookup2 = os .path .join (tmpdir , 'platforms' , 'avr8.xml' )
397+ lookup3 = os .path .join (path , 'avr8.xml' )
398+ lookup4 = os .path .join (path , 'platforms' , 'avr8.xml' )
399+ lines = stdout .splitlines ()
396400 assert lines == [
397401 "looking for platform 'avr8.xml'" ,
398- "try to load platform file '{}/avr8.xml ' ... Error=XML_ERROR_FILE_NOT_FOUND ErrorID=3 (0x3) Line number=0: filename={}/avr8.xml " .format (tmpdir , tmpdir ),
399- "try to load platform file '{}/platforms/avr8.xml ' ... Error=XML_ERROR_FILE_NOT_FOUND ErrorID=3 (0x3) Line number=0: filename={}/platforms/avr8.xml " .format (tmpdir , tmpdir ),
400- "try to load platform file '{}/avr8.xml ' ... Error=XML_ERROR_FILE_NOT_FOUND ErrorID=3 (0x3) Line number=0: filename={}/avr8.xml " .format (path , path ),
401- "try to load platform file '{}/platforms/avr8.xml ' ... Success" .format (path ),
402+ "try to load platform file '{}' ... Error=XML_ERROR_FILE_NOT_FOUND ErrorID=3 (0x3) Line number=0: filename={}" .format (lookup1 , lookup1 ),
403+ "try to load platform file '{}' ... Error=XML_ERROR_FILE_NOT_FOUND ErrorID=3 (0x3) Line number=0: filename={}" .format (lookup2 , lookup2 ),
404+ "try to load platform file '{}' ... Error=XML_ERROR_FILE_NOT_FOUND ErrorID=3 (0x3) Line number=0: filename={}" .format (lookup3 , lookup3 ),
405+ "try to load platform file '{}' ... Success" .format (lookup4 ),
402406 'Checking {} ...' .format (test_file )
403407 ]
404408
0 commit comments