LRsplines icon indicating copy to clipboard operation
LRsplines copied to clipboard

Add static analysis support

Open akva2 opened this issue 7 years ago • 2 comments

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.

akva2 avatar Aug 09 '17 10:08 akva2

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

VikingScientist avatar May 06 '20 06:05 VikingScientist

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.

akva2 avatar May 06 '20 07:05 akva2