@@ -26,37 +26,25 @@ def __create_unused_function_compile_commands(tmpdir):
26
26
return compile_commands
27
27
28
28
29
- def __test1 ( use_j ):
29
+ def test1 ( ):
30
30
args = [
31
31
'-q' ,
32
32
'--template=simple' ,
33
33
'--inline-suppr' ,
34
34
'proj-inline-suppress'
35
35
]
36
- if use_j :
37
- args .append ('-j2' )
38
36
ret , stdout , stderr = cppcheck (args , cwd = __script_dir )
39
37
assert stderr == ''
40
38
assert stdout == ''
41
39
assert ret == 0 , stdout
42
40
43
41
44
- def test1 ():
45
- __test1 (False )
46
-
47
-
48
- def test1_j ():
49
- __test1 (True )
50
-
51
-
52
- def __test2 (use_j ):
42
+ def test2 ():
53
43
args = [
54
44
'-q' ,
55
45
'--template=simple' ,
56
46
'proj-inline-suppress'
57
47
]
58
- if use_j :
59
- args .append ('-j2' )
60
48
ret , stdout , stderr = cppcheck (args , cwd = __script_dir )
61
49
lines = stderr .splitlines ()
62
50
assert lines == [
@@ -66,15 +54,7 @@ def __test2(use_j):
66
54
assert ret == 0 , stdout
67
55
68
56
69
- def test2 ():
70
- __test2 (False )
71
-
72
-
73
- def test2_j ():
74
- __test2 (True )
75
-
76
-
77
- def __test_unmatched_suppression (use_j ):
57
+ def test_unmatched_suppression ():
78
58
args = [
79
59
'-q' ,
80
60
'--template=simple' ,
@@ -84,8 +64,6 @@ def __test_unmatched_suppression(use_j):
84
64
'--error-exitcode=1' ,
85
65
'{}2.c' .format (__proj_inline_suppres_path )
86
66
]
87
- if use_j :
88
- args .append ('-j2' )
89
67
ret , stdout , stderr = cppcheck (args , cwd = __script_dir )
90
68
lines = stderr .splitlines ()
91
69
assert lines == [
@@ -95,15 +73,7 @@ def __test_unmatched_suppression(use_j):
95
73
assert ret == 1 , stdout
96
74
97
75
98
- def test_unmatched_suppression ():
99
- __test_unmatched_suppression (False )
100
-
101
-
102
- def test_unmatched_suppression_j ():
103
- __test_unmatched_suppression (True )
104
-
105
-
106
- def __test_unmatched_suppression_path_with_extra_stuff (use_j ):
76
+ def test_unmatched_suppression_path_with_extra_stuff ():
107
77
args = [
108
78
'-q' ,
109
79
'--template=simple' ,
@@ -113,8 +83,6 @@ def __test_unmatched_suppression_path_with_extra_stuff(use_j):
113
83
'--error-exitcode=1' ,
114
84
'{}2.c' .format (__proj_inline_suppres_path )
115
85
]
116
- if use_j :
117
- args .append ('-j2' )
118
86
ret , stdout , stderr = cppcheck (args , cwd = __script_dir )
119
87
lines = stderr .splitlines ()
120
88
assert lines == [
@@ -124,22 +92,12 @@ def __test_unmatched_suppression_path_with_extra_stuff(use_j):
124
92
assert ret == 1 , stdout
125
93
126
94
127
- def test_unmatched_suppression_path_with_extra_stuff ():
128
- __test_unmatched_suppression_path_with_extra_stuff (False )
129
-
130
-
131
- def test_unmatched_suppression_path_with_extra_stuff_j ():
132
- __test_unmatched_suppression_path_with_extra_stuff (True )
133
-
134
-
135
- def __test_backwards_compatibility (use_j ):
95
+ def test_backwards_compatibility ():
136
96
args = [
137
97
'-q' ,
138
98
'--template=simple' ,
139
99
'{}3.cpp' .format (__proj_inline_suppres_path )
140
100
]
141
- if use_j :
142
- args .append ('-j2' )
143
101
ret , stdout , stderr = cppcheck (args , cwd = __script_dir )
144
102
lines = stderr .splitlines ()
145
103
assert lines == [
@@ -154,23 +112,13 @@ def __test_backwards_compatibility(use_j):
154
112
'--inline-suppr' ,
155
113
'{}3.cpp' .format (__proj_inline_suppres_path )
156
114
]
157
- if use_j :
158
- args .append ('-j2' )
159
115
ret , stdout , stderr = cppcheck (args , cwd = __script_dir )
160
116
lines = stderr .splitlines ()
161
117
assert lines == []
162
118
assert stdout == ''
163
119
assert ret == 0 , stdout
164
120
165
121
166
- def test_backwards_compatibility ():
167
- __test_backwards_compatibility (False )
168
-
169
-
170
- def test_backwards_compatibility_j ():
171
- __test_backwards_compatibility (True )
172
-
173
-
174
122
def __test_compile_commands_unused_function (tmpdir , use_j ):
175
123
compdb_file = __create_unused_function_compile_commands (tmpdir )
176
124
args = [
@@ -182,6 +130,8 @@ def __test_compile_commands_unused_function(tmpdir, use_j):
182
130
]
183
131
if use_j :
184
132
args .append ('-j2' )
133
+ else :
134
+ args .append ('-j1' )
185
135
ret , stdout , stderr = cppcheck (args )
186
136
proj_path_sep = os .path .join (__script_dir , 'proj-inline-suppress-unusedFunction' ) + os .path .sep
187
137
lines = stderr .splitlines ()
@@ -213,6 +163,8 @@ def __test_compile_commands_unused_function_suppression(tmpdir, use_j):
213
163
]
214
164
if use_j :
215
165
args .append ('-j2' )
166
+ else :
167
+ args .append ('-j1' )
216
168
ret , stdout , stderr = cppcheck (args )
217
169
lines = stderr .splitlines ()
218
170
assert lines == []
@@ -229,7 +181,7 @@ def test_compile_commands_unused_function_suppression_j(tmpdir):
229
181
__test_compile_commands_unused_function_suppression (tmpdir , True )
230
182
231
183
232
- def __test_unmatched_suppression_ifdef ( use_j ):
184
+ def test_unmatched_suppression_ifdef ( ):
233
185
args = [
234
186
'-q' ,
235
187
'--template=simple' ,
@@ -239,24 +191,14 @@ def __test_unmatched_suppression_ifdef(use_j):
239
191
'-DNO_ZERO_DIV' ,
240
192
'trac5704/trac5704a.c'
241
193
]
242
- if use_j :
243
- args .append ('-j2' )
244
194
ret , stdout , stderr = cppcheck (args , cwd = __script_dir )
245
195
lines = stderr .splitlines ()
246
196
assert lines == []
247
197
assert stdout == ''
248
198
assert ret == 0 , stdout
249
199
250
200
251
- def test_unmatched_suppression_ifdef ():
252
- __test_unmatched_suppression_ifdef (False )
253
-
254
-
255
- def test_unmatched_suppression_ifdef_j ():
256
- __test_unmatched_suppression_ifdef (True )
257
-
258
-
259
- def __test_unmatched_suppression_ifdef_0 (use_j ):
201
+ def test_unmatched_suppression_ifdef_0 ():
260
202
args = [
261
203
'-q' ,
262
204
'--template=simple' ,
@@ -265,24 +207,14 @@ def __test_unmatched_suppression_ifdef_0(use_j):
265
207
'--inline-suppr' ,
266
208
'trac5704/trac5704b.c'
267
209
]
268
- if use_j :
269
- args .append ('-j2' )
270
210
ret , stdout , stderr = cppcheck (args , cwd = __script_dir )
271
211
lines = stderr .splitlines ()
272
212
assert lines == []
273
213
assert stdout == ''
274
214
assert ret == 0 , stdout
275
215
276
216
277
- def test_unmatched_suppression_ifdef_0 ():
278
- __test_unmatched_suppression_ifdef_0 (False )
279
-
280
-
281
- def test_unmatched_suppression_ifdef_0_j ():
282
- __test_unmatched_suppression_ifdef_0 (True )
283
-
284
-
285
- def __test_build_dir (tmpdir , use_j ):
217
+ def test_build_dir (tmpdir ):
286
218
args = [
287
219
'-q' ,
288
220
'--template=simple' ,
@@ -291,8 +223,6 @@ def __test_build_dir(tmpdir, use_j):
291
223
'--inline-suppr' ,
292
224
'{}4.c' .format (__proj_inline_suppres_path )
293
225
]
294
- if use_j :
295
- args .append ('-j2' )
296
226
297
227
ret , stdout , stderr = cppcheck (args , cwd = __script_dir )
298
228
lines = stderr .splitlines ()
@@ -307,14 +237,6 @@ def __test_build_dir(tmpdir, use_j):
307
237
assert ret == 0 , stdout
308
238
309
239
310
- def test_build_dir (tmpdir ):
311
- __test_build_dir (tmpdir , False )
312
-
313
-
314
- def test_build_dir_j (tmpdir ):
315
- __test_build_dir (tmpdir , True )
316
-
317
-
318
240
def __test_build_dir_unused_template (tmpdir , use_j ):
319
241
args = [
320
242
'-q' ,
@@ -326,6 +248,8 @@ def __test_build_dir_unused_template(tmpdir, use_j):
326
248
]
327
249
if use_j :
328
250
args .append ('-j2' )
251
+ else :
252
+ args .append ('-j1' )
329
253
330
254
ret , stdout , stderr = cppcheck (args , cwd = __script_dir )
331
255
lines = stderr .splitlines ()
@@ -343,7 +267,7 @@ def test_build_dir_unused_template_j(tmpdir):
343
267
__test_build_dir_unused_template (tmpdir , True )
344
268
345
269
346
- def __test_suppress_unmatched_inline_suppression ( use_j ): # 11172
270
+ def test_suppress_unmatched_inline_suppression ( ): # 11172
347
271
args = [
348
272
'-q' ,
349
273
'--template=simple' ,
@@ -353,18 +277,8 @@ def __test_suppress_unmatched_inline_suppression(use_j): # 11172
353
277
'--inline-suppr' ,
354
278
'{}2.c' .format (__proj_inline_suppres_path )
355
279
]
356
- if use_j :
357
- args .append ('-j2' )
358
280
ret , stdout , stderr = cppcheck (args , cwd = __script_dir )
359
281
lines = stderr .splitlines ()
360
282
assert lines == []
361
283
assert stdout == ''
362
284
assert ret == 0 , stdout
363
-
364
-
365
- def test_suppress_unmatched_inline_suppression ():
366
- __test_suppress_unmatched_inline_suppression (False )
367
-
368
-
369
- def test_suppress_unmatched_inline_suppression_j ():
370
- __test_suppress_unmatched_inline_suppression (True )
0 commit comments