@@ -767,12 +767,14 @@ def test_addon_lookup(tmpdir):
767767 exitcode , stdout , stderr , exe = cppcheck_ex (['--debug-lookup=addon' , '--addon=misra' , test_file ])
768768 exepath = os .path .dirname (exe )
769769 exepath_sep = exepath + os .path .sep
770+ if sys .platform == 'win32' :
771+ exepath_sep = exepath_sep .replace ('\\ ' , '/' )
770772 assert exitcode == 0 , stdout if stdout else stderr
771773 lines = stdout .splitlines ()
772774 assert lines == [
773775 "looking for addon 'misra.py'" ,
774776 "looking for addon '{}misra.py'" .format (exepath_sep ),
775- "looking for addon '{}addons/misra.py'" .format (exepath_sep ), # TODO: mixed separators
777+ "looking for addon '{}addons/misra.py'" .format (exepath_sep ),
776778 'Checking {} ...' .format (test_file )
777779 ]
778780
@@ -785,12 +787,14 @@ def test_addon_lookup_ext(tmpdir):
785787 exitcode , stdout , stderr , exe = cppcheck_ex (['--debug-lookup=addon' , '--addon=misra.py' , test_file ])
786788 exepath = os .path .dirname (exe )
787789 exepath_sep = exepath + os .path .sep
790+ if sys .platform == 'win32' :
791+ exepath_sep = exepath_sep .replace ('\\ ' , '/' )
788792 assert exitcode == 0 , stdout if stdout else stderr
789793 lines = stdout .splitlines ()
790794 assert lines == [
791795 "looking for addon 'misra.py'" ,
792796 "looking for addon '{}misra.py'" .format (exepath_sep ),
793- "looking for addon '{}addons/misra.py'" .format (exepath_sep ), # TODO: mixed separators
797+ "looking for addon '{}addons/misra.py'" .format (exepath_sep ),
794798 'Checking {} ...' .format (test_file )
795799 ]
796800
@@ -803,12 +807,14 @@ def test_addon_lookup_notfound(tmpdir):
803807 exitcode , stdout , _ , exe = cppcheck_ex (['--debug-lookup=addon' , '--addon=none' , test_file ])
804808 exepath = os .path .dirname (exe )
805809 exepath_sep = exepath + os .path .sep
810+ if sys .platform == 'win32' :
811+ exepath_sep = exepath_sep .replace ('\\ ' , '/' )
806812 assert exitcode == 1 , stdout
807813 lines = stdout .splitlines ()
808814 assert lines == [
809815 "looking for addon 'none.py'" ,
810816 "looking for addon '{}none.py'" .format (exepath_sep ),
811- "looking for addon '{}addons/none.py'" .format (exepath_sep ), # TODO: mixed separators
817+ "looking for addon '{}addons/none.py'" .format (exepath_sep ),
812818 'Did not find addon none.py'
813819 ]
814820
@@ -819,13 +825,15 @@ def test_addon_lookup_notfound_project(tmpdir): # #13940 / #13941
819825 exitcode , stdout , _ , exe = cppcheck_ex (['--debug-lookup=addon' , '--addon=none' , '--project={}' .format (project_file )])
820826 exepath = os .path .dirname (exe )
821827 exepath_sep = exepath + os .path .sep
828+ if sys .platform == 'win32' :
829+ exepath_sep = exepath_sep .replace ('\\ ' , '/' )
822830 assert exitcode == 1 , stdout
823831 lines = stdout .splitlines ()
824832 assert lines == [
825833 # TODO: needs to look relative to the project file first
826834 "looking for addon 'none.py'" ,
827835 "looking for addon '{}none.py'" .format (exepath_sep ),
828- "looking for addon '{}addons/none.py'" .format (exepath_sep ), # TODO: mixed separators
836+ "looking for addon '{}addons/none.py'" .format (exepath_sep ),
829837 'Did not find addon none.py'
830838 ]
831839
@@ -836,12 +844,14 @@ def test_addon_lookup_notfound_compdb(tmpdir):
836844 exitcode , stdout , _ , exe = cppcheck_ex (['--debug-lookup=addon' , '--addon=none' , '--project={}' .format (compdb_file )])
837845 exepath = os .path .dirname (exe )
838846 exepath_sep = exepath + os .path .sep
847+ if sys .platform == 'win32' :
848+ exepath_sep = exepath_sep .replace ('\\ ' , '/' )
839849 assert exitcode == 1 , stdout
840850 lines = stdout .splitlines ()
841851 assert lines == [
842852 "looking for addon 'none.py'" ,
843853 "looking for addon '{}none.py'" .format (exepath_sep ),
844- "looking for addon '{}addons/none.py'" .format (exepath_sep ), # TODO: mixed separators
854+ "looking for addon '{}addons/none.py'" .format (exepath_sep ),
845855 'Did not find addon none.py'
846856 ]
847857
@@ -854,12 +864,14 @@ def test_addon_lookup_ext_notfound(tmpdir):
854864 exitcode , stdout , _ , exe = cppcheck_ex (['--debug-lookup=addon' , '--addon=none.py' , test_file ])
855865 exepath = os .path .dirname (exe )
856866 exepath_sep = exepath + os .path .sep
867+ if sys .platform == 'win32' :
868+ exepath_sep = exepath_sep .replace ('\\ ' , '/' )
857869 assert exitcode == 1 , stdout
858870 lines = stdout .splitlines ()
859871 assert lines == [
860872 "looking for addon 'none.py'" ,
861873 "looking for addon '{}none.py'" .format (exepath_sep ),
862- "looking for addon '{}addons/none.py'" .format (exepath_sep ), # TODO: mixed separators
874+ "looking for addon '{}addons/none.py'" .format (exepath_sep ),
863875 'Did not find addon none.py'
864876 ]
865877
@@ -872,12 +884,14 @@ def test_addon_lookup_relative_notfound(tmpdir):
872884 exitcode , stdout , _ , exe = cppcheck_ex (['--debug-lookup=addon' , '--addon=addon/misra.py' , test_file ])
873885 exepath = os .path .dirname (exe )
874886 exepath_sep = exepath + os .path .sep
887+ if sys .platform == 'win32' :
888+ exepath_sep = exepath_sep .replace ('\\ ' , '/' )
875889 assert exitcode == 1 , stdout
876890 lines = stdout .splitlines ()
877891 assert lines == [
878892 "looking for addon 'addon/misra.py'" ,
879893 "looking for addon '{}addon/misra.py'" .format (exepath_sep ),
880- "looking for addon '{}addons/addon/misra.py'" .format (exepath_sep ), # TODO: mixed separators
894+ "looking for addon '{}addons/addon/misra.py'" .format (exepath_sep ),
881895 'Did not find addon addon/misra.py'
882896 ]
883897
@@ -891,12 +905,14 @@ def test_addon_lookup_relative_noext_notfound(tmpdir):
891905 exitcode , stdout , _ , exe = cppcheck_ex (['--debug-lookup=addon' , '--addon=addon/misra' , test_file ])
892906 exepath = os .path .dirname (exe )
893907 exepath_sep = exepath + os .path .sep
908+ if sys .platform == 'win32' :
909+ exepath_sep = exepath_sep .replace ('\\ ' , '/' )
894910 assert exitcode == 1 , stdout
895911 lines = stdout .splitlines ()
896912 assert lines == [
897913 "looking for addon 'addon/misra.py'" ,
898914 "looking for addon '{}addon/misra.py'" .format (exepath_sep ),
899- "looking for addon '{}addons/addon/misra.py'" .format (exepath_sep ), # TODO: mixed separators
915+ "looking for addon '{}addons/addon/misra.py'" .format (exepath_sep ),
900916 'Did not find addon addon/misra.py'
901917 ]
902918
@@ -1006,12 +1022,14 @@ def test_addon_lookup_nofile(tmpdir):
10061022 exitcode , stdout , stderr , exe = cppcheck_ex (['--debug-lookup=addon' , '--addon=misra' , test_file ])
10071023 exepath = os .path .dirname (exe )
10081024 exepath_sep = exepath + os .path .sep
1025+ if sys .platform == 'win32' :
1026+ exepath_sep = exepath_sep .replace ('\\ ' , '/' )
10091027 assert exitcode == 0 , stdout if stdout else stderr
10101028 lines = stdout .splitlines ()
10111029 assert lines == [
10121030 "looking for addon 'misra.py'" ,
10131031 "looking for addon '{}misra.py'" .format (exepath_sep ),
1014- "looking for addon '{}addons/misra.py'" .format (exepath_sep ), # TODO: mixed separators
1032+ "looking for addon '{}addons/misra.py'" .format (exepath_sep ),
10151033 'Checking {} ...' .format (test_file )
10161034 ]
10171035
0 commit comments