cppcheck/test/cli
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
..
helloworld added .gitattributes and normalized files (#4668) 2022-12-30 21:33:45 +01:00
proj-inline-suppress Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
proj-inline-suppress-unusedFunction test/cli: fixed missing returns in test cases 2021-07-04 18:25:19 +02:00
proj-suppress-syntaxError Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
proj2 added .gitattributes and normalized files (#4668) 2022-12-30 21:33:45 +01:00
trac5704 Fix unmatched suppression (#5704) (#3886) 2022-03-30 19:24:53 +02:00
readme.txt
test-clang-import.py Revert "Clang import; This experimental feature didn't "take off" much. After a lot of work we are still far fram the goal. I remove it now but don't rule out completely that it could ever be added again." 2021-04-30 16:47:02 +02:00
test-helloworld.py dump: Fix concurrency problem with dump files (#4757) 2023-02-13 20:54:21 +01:00
test-inline-suppress.py Fixed #11172 (Unmatched suppression for inline suppression even though --suppress=unmatchedSuppression is used) 2022-07-12 22:51:26 +02:00
test-more-projects.py greatly improved error handling in Cppcheck project file parsing / some cleanups (#4752) 2023-02-08 20:30:43 +01:00
test-other.py selfcheck : cleaned up some suppressions, fixed warnings and some cleanups (#4436) 2022-09-06 23:11:39 +02:00
test-proj2.py CI; Fixed problems in windows paths 2021-06-12 12:45:31 +02:00
test-project.py Fix #9162 (Invalid --project files do not give any error) (#3177) 2021-12-19 12:36:11 +01:00
test-suppress-syntaxError.py some Python cleanups based on PyCharm inspections (#2999) 2021-01-31 14:27:11 +01:00
testutils.py greatly improved error handling in Cppcheck project file parsing / some cleanups (#4752) 2023-02-08 20:30:43 +01:00

readme.txt

Systemtesting of Cppcheck CLI on some projects

addons
base path
exclude folders
importing projects
 * visual studio
 * compile database
   - different generators bear/cmake/..
   - different platforms
suppressions

Different paths:
 * relative
 * absolute