@@ -80,7 +80,7 @@ def test_unused_functions_qt_property(tmp_path, header, builddir):
8080 (tmp_path / 'build' ).mkdir ()
8181 args += ['--cppcheck-build-dir=' + str (tmp_path / 'build' )]
8282 else :
83- args += ['--no-cppcheck-build-dir' ]
83+ args += ['-j1' , '- -no-cppcheck-build-dir' ]
8484 # Also check the saved whole-program data when the build directory is reused.
8585 for _ in range (2 if builddir else 1 ):
8686 ret , stdout , stderr = cppcheck (args )
@@ -106,7 +106,7 @@ class MyType {
106106int main() { MyType t; }
107107''' )
108108 args = ['-q' , '--template={id}:{message}' , '--enable=unusedFunction' ,
109- '--no-cppcheck-build-dir' , str (source )]
109+ '-j1' , '- -no-cppcheck-build-dir' , str (source )]
110110 if library :
111111 args += ['--library=qt' ]
112112 ret , stdout , stderr = cppcheck (args )
@@ -135,7 +135,7 @@ def test_unused_functions_qt_property_configurations(tmp_path):
135135 # Both configurations have identical C++ tokens after Q_PROPERTY is erased.
136136 ret , stdout , stderr = cppcheck (['-q' , '--template={id}:{message}' ,
137137 '--enable=unusedFunction' , '--library=qt' ,
138- '--no-cppcheck-build-dir' , str (source )])
138+ '-j1' , '- -no-cppcheck-build-dir' , str (source )])
139139 assert ret == 0 , stdout
140140 assert stdout == ''
141141 assert stderr == "unusedFunction:The function 'unused' is never used.\n "
@@ -168,7 +168,7 @@ class MyType {
168168 .replace ('@RETURN_TYPE@' , '::READ' if property_type == 'READ' else property_type ))
169169 ret , stdout , stderr = cppcheck (['-q' , '--template={id}:{message}' ,
170170 '--enable=unusedFunction' , '--library=qt' ,
171- '--no-cppcheck-build-dir' , str (source )])
171+ '-j1' , '- -no-cppcheck-build-dir' , str (source )])
172172 assert ret == 0 , stdout
173173 assert stderr == ("unusedFunction:The function 'property' is never used.\n "
174174 "unusedFunction:The function 'NOTIFY' is never used.\n " )
@@ -188,7 +188,7 @@ def test_unused_functions_qt_property_reset_keyword_name(tmp_path):
188188 # The reset method named READ must not be read as another READ attribute.
189189 ret , stdout , stderr = cppcheck (['-q' , '--template={id}:{message}' ,
190190 '--enable=unusedFunction' , '--library=qt' ,
191- '--no-cppcheck-build-dir' , str (source )])
191+ '-j1' , '- -no-cppcheck-build-dir' , str (source )])
192192 assert ret == 0 , stdout
193193 assert stderr == "unusedFunction:The function 'property' is never used.\n "
194194
@@ -226,7 +226,7 @@ class MyType {
226226''' .replace ('@ATTRIBUTES@' , attributes ))
227227 ret , stdout , stderr = cppcheck (['-q' , '--template={id}:{message}' ,
228228 '--enable=unusedFunction' , '--library=qt' ,
229- '--no-cppcheck-build-dir' , str (source )])
229+ '-j1' , '- -no-cppcheck-build-dir' , str (source )])
230230 assert ret == 0 , stdout
231231 reported = re .findall (r"unusedFunction:The function '([^']+)' is never used\." , stderr )
232232 assert set (reported ) == {'field' , 'value' , 'setValue' , 'resetValue' , 'bindValue' , 'enabled' , 'property' } - set (used )
@@ -261,7 +261,7 @@ class MyType {
261261''' .replace ('@PROPERTY@' , invocation ))
262262 ret , stdout , stderr = cppcheck (['-q' , '--template={id}:{message}' ,
263263 '--enable=unusedFunction' , '--library=qt' ,
264- '--no-cppcheck-build-dir' , str (source )])
264+ '-j1' , '- -no-cppcheck-build-dir' , str (source )])
265265 assert ret == 0 , stdout
266266 assert stderr == "unusedFunction:The function 'property' is never used.\n "
267267
@@ -283,7 +283,7 @@ class MyType {
283283''' .replace ('@PROPERTY@' , invocation ))
284284 ret , stdout , stderr = cppcheck (['-q' , '--template={id}:{message}' ,
285285 '--enable=unusedFunction' , '--library=qt' ,
286- '--no-cppcheck-build-dir' , str (source )])
286+ '-j1' , '- -no-cppcheck-build-dir' , str (source )])
287287 assert ret == 0 , stdout
288288 assert stderr == "unusedFunction:The function 'value' is never used.\n "
289289
@@ -343,7 +343,7 @@ class MyType : public Base {
343343''' )
344344 ret , stdout , stderr = cppcheck (['-q' , '--template={id}:{message}' ,
345345 '--enable=unusedFunction' , '--library=qt' ,
346- '--no-cppcheck-build-dir' , str (source )])
346+ '-j1' , '- -no-cppcheck-build-dir' , str (source )])
347347 assert ret == 0 , stdout
348348 assert stderr == "unusedFunction:The function 'unused' is never used.\n "
349349
0 commit comments