@@ -220,8 +220,11 @@ def test_addon_rerun(tmp_path, builddir):
220220 '--enable=style' ,
221221 '--template={id}' ,
222222 'whole-program' ]
223+ # do not use the injection because the directory needs to survive runs
223224 if builddir :
224225 args .append ('--cppcheck-build-dir=' + str (tmp_path ))
226+ else :
227+ args .append ('--no-cppcheck-build-dir' )
225228 _ , _ , stderr = cppcheck (args , cwd = __script_dir )
226229 assert 'misra-c2012-5.8' in stderr
227230 _ , _ , stderr = cppcheck (args , cwd = __script_dir )
@@ -293,10 +296,9 @@ def test_checkclass():
293296 __test_checkclass (['-j1' ])
294297
295298
296- # whole program analysis requires a build dir with -j
297- @pytest .mark .xfail (strict = True )
299+ @pytest .mark .xfail (strict = True ) # TODO: check error
298300def test_checkclass_j ():
299- __test_checkclass (['-j2' ])
301+ __test_checkclass (['-j2' , '--no-cppcheck-build-dir' ])
300302
301303
302304def test_checkclass_builddir (tmpdir ):
@@ -305,6 +307,11 @@ def test_checkclass_builddir(tmpdir):
305307 __test_checkclass (['--cppcheck-build-dir={}' .format (build_dir )])
306308
307309
310+ def test_checkclass_builddir_j (tmpdir ):
311+ build_dir = os .path .join (tmpdir , 'b1' )
312+ os .mkdir (build_dir )
313+ __test_checkclass (['-j2' , '--cppcheck-build-dir={}' .format (build_dir )])
314+
308315def __test_checkclass_project (tmpdir , extra_args ):
309316 odr_file_1 = os .path .join (__script_dir , 'whole-program' , 'odr1.cpp' )
310317
@@ -336,14 +343,18 @@ def test_checkclass_project(tmpdir):
336343 __test_checkclass_project (tmpdir , ['-j1' ])
337344
338345
339- # whole program analysis requires a build dir with -j
340- @pytest .mark .xfail (strict = True )
346+ @pytest .mark .xfail (strict = True ) # TODO: check error
341347def test_checkclass_project_j (tmpdir ):
342- __test_checkclass_project (tmpdir , ['-j2' ])
348+ __test_checkclass_project (tmpdir , ['-j2' , '--no-cppcheck-build-dir' ])
343349
344350
345351def test_checkclass_project_builddir (tmpdir ):
346352 build_dir = os .path .join (tmpdir , 'b1' )
347353 os .mkdir (build_dir )
348354 __test_checkclass_project (tmpdir , ['-j1' , '--cppcheck-build-dir={}' .format (build_dir )])
349355
356+
357+ def test_checkclass_project_builddir_j (tmpdir ):
358+ build_dir = os .path .join (tmpdir , 'b1' )
359+ os .mkdir (build_dir )
360+ __test_checkclass_project (tmpdir , ['-j2' , '--cppcheck-build-dir={}' .format (build_dir )])
0 commit comments