cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

Added more failing tests for whole program analysis

Open dzid26 opened this issue 1 year ago • 2 comments

  • I disabled the test that don't work. In the same time I commented the asserts lines that otherwise are required to make the tests pass.
  • Also added printing Analyzing whole program to help quickly visualize where errors come from.

dzid26 avatar Jun 26 '24 20:06 dzid26

I was getting to those hopefully soon.

As you can see the existing PR was approved/merged just today. And I just posted my own follow-up earlier.

I am also not feeling too well at the moment so I was only able to post/adjust pre-existing work I did and have not been able to do any new stuff yet.

firewave avatar Jun 26 '24 22:06 firewave

Ah, you opened the other PR against a branch of mine which I already deleted. Didn't even realize that.

My tests have finally been merged and I pushed the first bugfix. After that has been merged I will dissect your tests and pull in what is still relevant.

firewave avatar Jul 01 '24 13:07 firewave

Just checking-in after seeing release note:

The whole program analysis is now being executed when "--project" is being used.

After rebasing, tests below still fail due to the ordering of defines in the compile_db.

This means plugins and unusedStructMember/unusedFunction modules still don't parse the whole project, but a single (first encountered) configuration from the compile_db.

test_unused_with_project_A_and_B fails with following false positives:

        configs_unused.c:3:9: style: struct member 'X::x' is never used. [unusedStructMember]
        configs_unused.c:6:13: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-5.9]
        configs_unused.c:2:1: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-2.3]

and test_unused_with_project_B_or_A fails with following false positives:

  +     'configs_unused.c:3:9: "style: struct member 'X::x' is never used. [unusedStructMember]",
  +     'configs_unused.c:6:13: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-5.9],

With --force unusedStructMember/unusedFunction violations disappear, but misra 2.3 remains, but first things first.

dzid26 avatar Sep 16 '24 02:09 dzid26

This is still in my scope but I got side tracked with some more fundamental stuff again. I also didn't feel like looking at creating new Python tests in the past few weeks...

firewave avatar Sep 29 '24 00:09 firewave