@@ -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,29 @@ 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 ' % filename
7676 assert stderr == ('[%s:5]: (error) Division by zero.\n '
7777 '[%s:1]: (style) misra violation (use --rule-texts=<file> to get proper output)\n ' % (filename , filename ))
7878
79- def test_addon_relative_path ():
79+ def test_addon_with_gui_project ():
8080 project_file = 'helloworld/test.cppcheck'
8181 create_gui_project_file (project_file , paths = ['.' ], addon = 'misra' )
8282 ret , stdout , stderr = cppcheck (['--template=cppcheck1' , '--project=' + project_file ])
8383 filename = os .path .join ('helloworld' , 'main.c' )
8484 assert ret == 0
85- assert stdout == 'Checking %s ...\n ' % ( filename )
85+ assert stdout == 'Checking %s ...\n ' % filename
8686 assert stderr == ('[%s:5]: (error) Division by zero.\n '
8787 '[%s:1]: (style) misra violation (use --rule-texts=<file> to get proper output)\n ' % (filename , filename ))
8888
8989def test_basepath_relative_path ():
9090 prjpath = getRelativeProjectPath ()
9191 ret , stdout , stderr = cppcheck ([prjpath , '--template=cppcheck1' , '-rp=' + prjpath ])
92- filename = os .path .join (prjpath , 'main.c' )
9392 assert ret == 0
9493 assert stderr == '[main.c:5]: (error) Division by zero.\n '
9594
9695def test_basepath_absolute_path ():
9796 prjpath = getAbsoluteProjectPath ()
9897 ret , stdout , stderr = cppcheck (['--template=cppcheck1' , prjpath , '-rp=' + prjpath ])
99- filename = os .path .join (prjpath , 'main.c' )
10098 assert ret == 0
10199 assert stderr == '[main.c:5]: (error) Division by zero.\n '
102100
@@ -112,15 +110,15 @@ def test_vs_project_relative_path():
112110 filename = os .path .join (prjpath , 'main.c' )
113111 assert ret == 0
114112 assert getVsConfigs (stdout , filename ) == 'Debug|Win32 Debug|x64 Release|Win32 Release|x64'
115- assert stderr == '[%s:5]: (error) Division by zero.\n ' % ( filename )
113+ assert stderr == '[%s:5]: (error) Division by zero.\n ' % filename
116114
117115def test_vs_project_absolute_path ():
118116 prjpath = getAbsoluteProjectPath ()
119117 ret , stdout , stderr = cppcheck (['--template=cppcheck1' , '--project=' + os .path .join (prjpath , 'helloworld.vcxproj' )])
120118 filename = os .path .join (prjpath , 'main.c' )
121119 assert ret == 0
122120 assert getVsConfigs (stdout , filename ) == 'Debug|Win32 Debug|x64 Release|Win32 Release|x64'
123- assert stderr == '[%s:5]: (error) Division by zero.\n ' % ( filename )
121+ assert stderr == '[%s:5]: (error) Division by zero.\n ' % filename
124122
125123def test_cppcheck_project_local_path ():
126124 ret , stdout , stderr = cppcheck_local (['--template=cppcheck1' , '--platform=win64' , '--project=helloworld.cppcheck' ])
@@ -134,15 +132,15 @@ def test_cppcheck_project_relative_path():
134132 filename = os .path .join (prjpath , 'main.c' )
135133 assert ret == 0
136134 assert getVsConfigs (stdout , filename ) == 'Debug|x64'
137- assert stderr == '[%s:5]: (error) Division by zero.\n ' % ( filename )
135+ assert stderr == '[%s:5]: (error) Division by zero.\n ' % filename
138136
139137def test_cppcheck_project_absolute_path ():
140138 prjpath = getAbsoluteProjectPath ()
141139 ret , stdout , stderr = cppcheck (['--template=cppcheck1' , '--platform=win64' , '--project=' + os .path .join (prjpath , 'helloworld.cppcheck' )])
142140 filename = os .path .join (prjpath , 'main.c' )
143141 assert ret == 0
144142 assert getVsConfigs (stdout , filename ) == 'Debug|x64'
145- assert stderr == '[%s:5]: (error) Division by zero.\n ' % ( filename )
143+ assert stderr == '[%s:5]: (error) Division by zero.\n ' % filename
146144
147145def test_suppress_command_line ():
148146 prjpath = getRelativeProjectPath ()
0 commit comments