@@ -11,7 +11,7 @@ def cppcheck_local(args):
1111 os .chdir ('helloworld' )
1212 ret , stdout , stderr = cppcheck (args )
1313 os .chdir (cwd )
14- return ( ret , stdout , stderr )
14+ return ret , stdout , stderr
1515
1616def getRelativeProjectPath ():
1717 return 'helloworld'
@@ -24,7 +24,7 @@ def getAbsoluteProjectPath():
2424def getVsConfigs (stdout , filename ):
2525 ret = []
2626 for line in stdout .split ('\n ' ):
27- if not line .startswith ('Checking %s ' % ( filename ) ):
27+ if not line .startswith ('Checking %s ' % filename ):
2828 continue
2929 if not line .endswith ('...' ):
3030 continue
@@ -38,7 +38,7 @@ def test_relative_path():
3838 ret , stdout , stderr = cppcheck (['--template=cppcheck1' , 'helloworld' ])
3939 filename = os .path .join ('helloworld' , 'main.c' )
4040 assert ret == 0
41- assert stderr == '[%s:5]: (error) Division by zero.\n ' % ( filename )
41+ assert stderr == '[%s:5]: (error) Division by zero.\n ' % filename
4242
4343
4444def test_local_path ():
@@ -51,7 +51,7 @@ def test_absolute_path():
5151 ret , stdout , stderr = cppcheck (['--template=cppcheck1' , prjpath ])
5252 filename = os .path .join (prjpath , 'main.c' )
5353 assert ret == 0
54- assert stderr == '[%s:5]: (error) Division by zero.\n ' % ( filename )
54+ assert stderr == '[%s:5]: (error) Division by zero.\n ' % filename
5555
5656def test_addon_local_path ():
5757 ret , stdout , stderr = cppcheck_local (['--addon=misra' , '--template=cppcheck1' , '.' ])
@@ -72,31 +72,30 @@ def test_addon_relative_path():
7272 ret , stdout , stderr = cppcheck (['--addon=misra' , '--template=cppcheck1' , prjpath ])
7373 filename = os .path .join (prjpath , 'main.c' )
7474 assert ret == 0
75- assert stdout == 'Checking %s ...\n ' % (filename )
75+ assert stdout == ('Checking %s ...\n '
76+ 'Checking %s: SOME_CONFIG...\n ' % (filename , filename ))
7677 assert stderr == ('[%s:5]: (error) Division by zero.\n '
7778 '[%s:1]: (style) misra violation (use --rule-texts=<file> to get proper output)\n ' % (filename , filename ))
7879
79- def test_addon_relative_path ():
80+ def test_addon_with_gui_project ():
8081 project_file = 'helloworld/test.cppcheck'
8182 create_gui_project_file (project_file , paths = ['.' ], addon = 'misra' )
8283 ret , stdout , stderr = cppcheck (['--template=cppcheck1' , '--project=' + project_file ])
8384 filename = os .path .join ('helloworld' , 'main.c' )
8485 assert ret == 0
85- assert stdout == 'Checking %s ...\n ' % ( filename )
86+ assert stdout == 'Checking %s ...\n ' % filename
8687 assert stderr == ('[%s:5]: (error) Division by zero.\n '
8788 '[%s:1]: (style) misra violation (use --rule-texts=<file> to get proper output)\n ' % (filename , filename ))
8889
8990def test_basepath_relative_path ():
9091 prjpath = getRelativeProjectPath ()
9192 ret , stdout , stderr = cppcheck ([prjpath , '--template=cppcheck1' , '-rp=' + prjpath ])
92- filename = os .path .join (prjpath , 'main.c' )
9393 assert ret == 0
9494 assert stderr == '[main.c:5]: (error) Division by zero.\n '
9595
9696def test_basepath_absolute_path ():
9797 prjpath = getAbsoluteProjectPath ()
9898 ret , stdout , stderr = cppcheck (['--template=cppcheck1' , prjpath , '-rp=' + prjpath ])
99- filename = os .path .join (prjpath , 'main.c' )
10099 assert ret == 0
101100 assert stderr == '[main.c:5]: (error) Division by zero.\n '
102101
@@ -112,15 +111,15 @@ def test_vs_project_relative_path():
112111 filename = os .path .join (prjpath , 'main.c' )
113112 assert ret == 0
114113 assert getVsConfigs (stdout , filename ) == 'Debug|Win32 Debug|x64 Release|Win32 Release|x64'
115- assert stderr == '[%s:5]: (error) Division by zero.\n ' % ( filename )
114+ assert stderr == '[%s:5]: (error) Division by zero.\n ' % filename
116115
117116def test_vs_project_absolute_path ():
118117 prjpath = getAbsoluteProjectPath ()
119118 ret , stdout , stderr = cppcheck (['--template=cppcheck1' , '--project=' + os .path .join (prjpath , 'helloworld.vcxproj' )])
120119 filename = os .path .join (prjpath , 'main.c' )
121120 assert ret == 0
122121 assert getVsConfigs (stdout , filename ) == 'Debug|Win32 Debug|x64 Release|Win32 Release|x64'
123- assert stderr == '[%s:5]: (error) Division by zero.\n ' % ( filename )
122+ assert stderr == '[%s:5]: (error) Division by zero.\n ' % filename
124123
125124def test_cppcheck_project_local_path ():
126125 ret , stdout , stderr = cppcheck_local (['--template=cppcheck1' , '--platform=win64' , '--project=helloworld.cppcheck' ])
@@ -134,15 +133,15 @@ def test_cppcheck_project_relative_path():
134133 filename = os .path .join (prjpath , 'main.c' )
135134 assert ret == 0
136135 assert getVsConfigs (stdout , filename ) == 'Debug|x64'
137- assert stderr == '[%s:5]: (error) Division by zero.\n ' % ( filename )
136+ assert stderr == '[%s:5]: (error) Division by zero.\n ' % filename
138137
139138def test_cppcheck_project_absolute_path ():
140139 prjpath = getAbsoluteProjectPath ()
141140 ret , stdout , stderr = cppcheck (['--template=cppcheck1' , '--platform=win64' , '--project=' + os .path .join (prjpath , 'helloworld.cppcheck' )])
142141 filename = os .path .join (prjpath , 'main.c' )
143142 assert ret == 0
144143 assert getVsConfigs (stdout , filename ) == 'Debug|x64'
145- assert stderr == '[%s:5]: (error) Division by zero.\n ' % ( filename )
144+ assert stderr == '[%s:5]: (error) Division by zero.\n ' % filename
146145
147146def test_suppress_command_line ():
148147 prjpath = getRelativeProjectPath ()
0 commit comments