Skip to content

Add static analysis support#19

Open
akva2 wants to merge 2 commits intoVikingScientist:masterfrom
akva2:add_sca
Open

Add static analysis support#19
akva2 wants to merge 2 commits intoVikingScientist:masterfrom
akva2:add_sca

Conversation

@akva2
Copy link
Collaborator

@akva2 akva2 commented Aug 9, 2017

This adds clang support and static analysis support to the build system.

In general: You execute the tests by

ctest -C analyze|cppcheck|clang-check

analyze configuration executes both analyzers.

To enable the clang-check based tests, it is best to build with clang since the compatiblity with gcc is only 99% and clang-check uses the build command from the build system so all switches are passed. You also have to pass -DCMAKE_EXPORT_COMPILE_COMMANDS=1 when configuring.

@VikingScientist
Copy link
Owner

cd Debug
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
make -j4
ctest -C analyze|cppcheck|clang-check
cd ..
ctest -C analyze|cppcheck|clang-check

does not run any tests.

I simply get the following error output

clang-check: command not found

@akva2
Copy link
Collaborator Author

akva2 commented May 6, 2020

uhm, it still works for me. you do realize that's a regexp style alternative list ?

ctest -C analyze

runs both analyzers,

ctest -C cppcheck

runs only cppcheck,

ctest -C clang-check

runs only clang-check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants