cppcheck/test
Michael Drake d651b6baf1
dump: Fix concurrency problem with dump files (#4757)
* dump: Fix concurrency problem with dump files

This adds the process ID for the cppcheck process to the filenames
of the .dump and .ctu-info files that the process generates.

So
  lib/cppcheck.cpp.dump
becomes
  lib/cppcheck.cpp.<PID>.dump

For example:
  lib/cppcheck.cpp.2637871.dump

The reason for this change is that if there is a buildsystem which
supports concurrency, multiple instances of cppcheck may be run for
the same file.  For example, if the same file is compiled in multiple
build variants, or for multiple targets.

If running the MISRA plugin over such a project with concurrency
enabled in the buildsystem, the plugin ends up crashing as multiple
jobs attempt to create/trample/delete the same files while other
jobs are using them.

For more information see:
    https://sourceforge.net/p/cppcheck/discussion/general/thread/02c757b4af/

* dump: Include pid in filename if dump not explicit

Only change the dump and ctu-info filenames to include the PID if
they are being generated due to an addon.

This means that existing scripts that use `--dump` will still work
if they depend on the previous naming behaviour. The more robust
filenames containing the pid will be used when the dump files are
used as an internal implementation detail for passing data to addons.

However this means that anything that does explicitly use `--dump`
will be susceptible to concurrency problems.

* test: Update addon dump file test to account for pid

This test causes a dump file to be created by enabling the misra
addon. Since the dump files now include the cppcheck process pid
this test had to be updated to account for the change.
2023-02-13 20:54:21 +01:00
..
cfg std.cfg: added support for more container methods (#4780) 2023-02-11 10:48:17 +01:00
cli dump: Fix concurrency problem with dump files (#4757) 2023-02-13 20:54:21 +01:00
CMakeLists.txt added CMake option `BUILD_CORE_DLL` to build lib as `cppcheck-core.dll` with Visual Studio (#4733) 2023-01-26 22:13:07 +01:00
fixture.cpp Update copyright year 2023-01-28 10:16:34 +01:00
fixture.h improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
helpers.cpp improved testing of missing includes / made it possible to clear the include cache in simplecpp (#4704) 2023-02-07 22:02:12 +01:00
helpers.h improved testing of missing includes / made it possible to clear the include cache in simplecpp (#4704) 2023-02-07 22:02:12 +01:00
main.cpp Update copyright year 2023-01-28 10:16:34 +01:00
options.cpp Update copyright year 2023-01-28 10:16:34 +01:00
options.h Update Copyrights 2022-08-28 14:22:12 +02:00
precompiled.h updated precompiled headers based on `ClangBuildAnalyzer` (#4775) 2023-02-08 08:19:21 +01:00
redirect.h Update copyright year 2023-01-28 10:16:34 +01:00
test64bit.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testanalyzerinformation.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testassert.cpp Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
testastutils.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testautovariables.cpp Add test for FP fixed by e8c3a80 (#4768) 2023-02-07 22:09:55 +01:00
testbool.cpp Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
testboost.cpp Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
testbufferoverrun.cpp Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
testcharvar.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testclangimport.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testclass.cpp Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
testcmdlineparser.cpp greatly improved error handling in Cppcheck project file parsing / some cleanups (#4752) 2023-02-08 20:30:43 +01:00
testcondition.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testconstructors.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testcppcheck.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testerrorlogger.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testexceptionsafety.cpp Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
testfilelister.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testfunctions.cpp Fix FP ignoredReturnValue (#4783) 2023-02-11 10:46:04 +01:00
testgarbage.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testimportproject.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testincompletestatement.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testinternal.cpp Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
testio.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testleakautovar.cpp Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
testlibrary.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testmathlib.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testmemleak.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testnullpointer.cpp Fix #11458 nullPointer false positive (#4758) 2023-02-06 22:06:04 +01:00
testoptions.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testother.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testpath.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testpathmatch.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testplatform.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testpostfixoperator.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testpreprocessor.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testprocessexecutor.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testrunner.vcxproj improved testing of missing includes / made it possible to clear the include cache in simplecpp (#4704) 2023-02-07 22:02:12 +01:00
testrunner.vcxproj.filters generate `*.vcxproj` file lists with `dmake` (#4652) 2023-01-21 11:55:36 +01:00
testsettings.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testsimplifytemplate.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testsimplifytokens.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testsimplifytypedef.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testsimplifyusing.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testsizeof.cpp Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
teststl.cpp Set functions for calls through iterators (#4763) 2023-02-07 21:57:59 +01:00
teststring.cpp Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
testsummaries.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testsuppressions.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testsymboldatabase.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testthreadexecutor.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testtimer.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testtoken.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testtokenize.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testtokenlist.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testtokenrange.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testtype.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testuninitvar.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testunusedfunctions.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testunusedprivfunc.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testunusedvar.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testutils.cpp Update copyright year 2023-01-28 10:16:34 +01:00
testvaarg.cpp Check: disallow more than one instance per check (#4749) 2023-01-29 17:23:03 +01:00
testvalueflow.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00
testvarid.cpp improved setting of platform in tests / also improved platform tests (#4787) 2023-02-11 10:44:56 +01:00